Jump to content

Ajax Request And Server Response


Chikwado
 Share

Recommended Posts

Are you checking for any errors yourself? What have you done to debug the code? It should be obvious from the second you try and execute that code if you have your browsers console open, as it will give you a line number and file name.

 

hint

Link to comment
Share on other sites

Press F12 to open the error console, then run the code.

 

Here's the first problem:

ReferenceError: xmlHttpRequest is not defined

xhttp = new xmlHttpRequest();

 

That should be XmlHttpRequest. Javascript is case-sensitive.

 

You should also be declaring all your variables with the var keyword:

 

var xhttp = new XmlHttpRequest();

Link to comment
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
 Share

×
×
  • Create New...