Jump to content

Please Help Before I Go Insane (With Myself Lol)


jsmith1981

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...