Skip to main content
Arduino

Return to Revisions

3 of 3
replaced http://stackoverflow.com/ with https://stackoverflow.com/

This is more of a Stack Overflow question, but I'll help you a bit. The problem has nothing to do with your Arduino per-say. It has more to do with your PHP/Ajax.

Your code is suited for a completely local setup, but pulls from a remote site, which violates some security protocols build into your browser and jQuery. You need to change your code to this:

$.ajax({
 url: 'http://192.168.1.177/',
 type: 'post',
 data: { tag: 'getData'},
 dataType: 'jsonp',
 async: false,
 success: function (data) {
 $('#TemperaturaInterior').val(data.TemperaturaInterior).show();
 $('#TemperaturaExterior').val(data.TemperaturaExterior).show();
 }
 });
(may need slight modifications since you didn't include all PHP/html code)

For more information, see the jQuery documentation, particularly look at data types and what it says about cross-domain json vs jsonp.

Here is a relevant SO question.

Ian M
  • 121
  • 5

AltStyle によって変換されたページ (->オリジナル) /