Simple AJAX/ASP Classic but not getting back the page response

amo3k

New Member
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 of: ---> strURLinfo (\[code\]Example: "http://1.1.1.10:9187/sendsms?phone=4041230207&password=TESTPASS&text=test"\[/code\]) the page would load and it would say: "Message SENT!"HTML for this page is:\[code\]<html><body>Mesage SENT!<br/></body></html>\[/code\]But when I try this it will not show me the Message SENT! in the div, 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 No error, just says: Sending Message...... Please wait...THANKS FOR ANY HELP
 
Back
Top