Jump to content
Killersites Community
Sign in to follow this  
jsmith1981

Please Help Before I Go Insane (With Myself Lol)

Recommended Posts

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×