Simple AJAX responseText not working

I have an ASP (Classic) page that uses AJAX and I'm trying to send an sms message and then get a message back saying that the message was sent, The sms message is sent and this works but the page should say that the message has been sent but it doesn't.THE CODE:\[code\] <% dim strURLinfo strURLinfo = "http://1.1.1.10:9187/sendsms?phone=" & Request.QueryString("phone") & "&password=TESTPASS&text=" & Request.QueryString("text")'// EXAMPLE URL: http://1.1.1.10:9187/sendsms?phone=4041230207&password=TESTPASS&text=test %> <html> <meta http-equiv="PRAGMA" value="http://stackoverflow.com/questions/13729584/NO-CACHE"> <head> <script type="text/javascript"> //This is to AUTO resend every 20 seconds DISABLED ---> var int=self.setInterval("loadXMLDoc()",20000); function loadXMLDoc() { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","<%=strURLinfo%>",true); xmlhttp.send(); } </script> </head> <body onload="loadXMLDoc();"> <div id="myDiv" style="width: 100%"> <h3><center>Sending Message....... Please wait....</center></h3> <button type="button" onclick="loadXMLDoc()">Resend Message</button> </div> </body> </html>\[/code\]Now if I was to go enter the URL in the address bar of the browser as: ---> strURLinfo (\[code\]Example: "http://1.1.1.10:9187/sendsms?phone=4041230207&password=TESTPASS&text=test"\[/code\]) the page would load and it would send the sms message and it would say: "Message SENT!"But it will not do it via AJAX/xmlhttpHTML for the message sent page is:\[code\]<html><body>Mesage SENT!<br/></body></html>\[/code\]Can someone tell me how to make this work please. I got this example from http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_first I don't get any errors, just says: Sending Message...... Please wait... the responseText never changes the div message.THANKS FOR ANY HELP
 
Back
Top