loureirorg / mwsx

Ajax library
2 stars 1 forks source link

mwsX - write in one language, run in all

mwsX it's a non-intrusive library to remotelly call a function, independent of which language it was written (aka "webservice"). You can include your PHP file in Javascript and access the PHP functions, or call Ruby methods in PHP, even in different server.

Some uses

Use example

<?php
// this file: my_php.php
require "mwsx.php";

/* _EXPORT_ */
function my_function($a) {
    return my_function("Hello $a");
}
<!-- this file: my_html.html -->
<script type="text/javascript" src="https://github.com/loureirorg/mwsx/raw/master/mwsx.js"></script>
<script type="text/javascript">
    require_ws("my_php.php?mwsd");

    alert(my_function("World"));
</script>

Calling "my_html.html" an alert will popup with "Hello World" message

Features

Requirements at PHP side

Goals