Yun bridge example through AJAX -- how to get messages?
the bridge example yun (https://www.arduino.cc/en/tutorial/bridge) works fine -- use 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 example http://arduino.local/arduino/analog/11/200.
when use above getfile() search database through php result back; when use getfile('http://arduino.local/arduino/analog/11/200') command executet on yun don't result -- no message 'pin d11 set analog 200'. need message read pins -- how messages?
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 example http://arduino.local/arduino/analog/11/200.
when use above getfile() search database through php result back; when use getfile('http://arduino.local/arduino/analog/11/200') command executet on yun don't result -- no message 'pin d11 set analog 200'. need message read pins -- how messages?
in example http://www.tecnomacs.com/2016/12/03/lets-do-a-simple-webserver-ui-for-arduino-yun-using-bootstrap/ show how post jquery. check code in github, receive responses bridge example have add special headers response enable cors.
Arduino Forum > Products > Arduino Yún (Moderator: fabioc84) > Yun bridge example through AJAX -- how to get messages?
arduino
Comments
Post a Comment