Hello. I don't know how skilled the developers here are, but I could use some assistance with some ajax I'm working on. Based on the ajax tutorials I have seen, its not all that hard, and I have had no trouble getting it to request the target page. The trouble is trying to read the return data and make use of it.
Here is a copy of my ajax page:
As you can see, this is still a very basic ajax request example, but I still get no data from the return value. If anyone can help me understand why this isn't working correctly, I would certainly appreciate it.Code:<html> <body> <script type="text/javascript"> function doAjax() { var link; if(window.XMLHttpRequest) { link = new XMLHttpRequest(); }else if(window.ActiveXObject){ link = new ActiveXObject("Microsoft.XMLHTTP"); }else{ alert("Sorry, your browser doesn't support ajax"); } link.onreadystatechange = function() { if(link.readyState==4) { alert(link.responseText); } } link.open("get", "test.php", true); link.setRequestHeader('content-type', 'text/xml'); link.send(null); } </script> <form> <input type="submit" value="testnow" onclick="doAjax()"> </form> </body> </html>


LinkBack URL
About LinkBacks
Reply With Quote
