jsmith1981 Posted December 7, 2013 Report Share Posted December 7, 2013 I have a very basic (as simple as you can possibly get) ajax script. Problem is never seems to work when I type in, but when I compare line by line with the most basic example on the w3schools (again that works when I copy and paste, but I hate doing that, despise it personally with myself). Works when I copied and pasted, then compared line by line mine to theirs, but it's just still not working makes no sense to me at all. Could someone help me with this? function loadXMLDoc() { var xmlhttp; if(window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { alert(xmlhttp); } } It's the w3schools one: http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_first see when I copy up to where I have the alert, I change the w3schools example and it works, just baffling me to no end, what's wrong with what I am doing? I'd really love to know. Thanks in advance everyone Jeremy. Quote Link to comment Share on other sites More sharing options...
jsmith1981 Posted December 7, 2013 Author Report Share Posted December 7, 2013 Hmm not sure why this wasn't working but have got it now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.