jquery - Ajax where to debug -
i have basic webpage makes ajax call aspx file.
it works great on development machine. when test on production machine nohting nor kind of error.
i have different ip addresses's , port number's between 2 machines. have checked these differences handled.
the page displays ok , reponds click event ok.
the production machine worked once when setup localhost call once changed that, stopped. have rechecked ip , port , correct.
i have copied file couple of times in case of corruption.
the thing can think port number 20201, shouldn't use.
the dev machine win7 target xp, both running xampp.
it supposed custom page home automation, ajax call speak software called homeseer.
where or can change see whats wrong.
i puzzled works great in test , nothing positive or negative in production world.
many help.
<!doctype html> <html> <head> <script type="text/javascript" src="jquery/jquery-1.7.1.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ alert($(this).parent().attr("class")); var $x10device = $(this).parent().attr("class"); $.ajax({ type: 'get', url: "http://192.168.0.34:81/tenhsserver/tenhsserver.aspx", data: { t: "ab", f: "toggledevice" , d:$x10device } }); }); }); </script> </head> <body> <div id="div1"><h2>let jquery ajax change text</h2></div> <span class='c8'><button>8get external content</button></span> <span class='c1'><button>1get external content</button></span> <span class='c2'><button>2get external content</button></span> <span class='c3'><button>3get external content</button></span> <span class='c4'><button>4get external content</button></span> <span class='c5'><button>5get external content</button></span> </body> </html>
add error callback ajax()
arguments. eg:
$.ajax({ type: 'get', url: "http://192.168.0.34:81/tenhsserver/tenhsserver.aspx", data: { t: "ab", f: "toggledevice" , d:$x10device }, error: function (jqxhr, textstatus, errorthrown) { console.debug (textstatus, errorthrown); } });
Comments
Post a Comment