Yun bridge example through AJAX -- how to get messages?

The Bridge example for Yun (https://www.arduino.cc/en/Tutorial/Bridge) works fine – but what I would like to do is to use it from another website through AJAX –

function getFile(url) {
if (window.XMLHttpRequest) {
AJAX=new XMLHttpRequest();
} else {
AJAX=new ActiveXObject(“Microsoft.XMLHTTP”);
}
if (AJAX) {
AJAX.open(“GET”, url, true);
AJAX.send(null);
return AJAX.responseText;
} else {
return false;
}
}

the url is then for example http://arduino.local/arduino/analog/11/200.

When I use the above getFile() to search a database through PHP I get the result back; when I use it like getFile(‘http://arduino.local/arduino/analog/11/200’) the command is executet on the Yun but I don’t get any result – no message ‘Pin D11 set to analog 200’. As I will need the message to read pins – how do I get the messages?

In this example http://www.tecnomacs.com/2016/12/03/lets-do-a-simple-webserver-ui-for-arduino-yun-using-bootstrap/ I show how to post with jquery. Check the code in github, to receive responses from bridge example you have to add special headers to the response to enable CORS.