Question on the very basics of Ajax with PHP?

Waldo

New member
I have a function in my Javascript that is supposed to send an XMLHttpRequest to my php file, and then the onreadystatechange will fire a function to display the info returned from the php file. However, I get a 404 status every time, like the Javascript can't even see the php file, even though they are in the same directory on my server. What am I doing wrong? Here's the Javascript:

function getDetails(bookTitle) {

request = createRequest();

if (request == null) {
alert("Unable to create request!");
return;
}

var url = "getDetails.php?bookTitle=" + escape(bookTitle);
request.open("GET",url,true);
request.onreadystatechange = displayDetails;
request.send(null);
}
 
As a general rule, you should never use capital letters in any file name (specially not on a server). The GET parameters are fine to use capital, but try to use lowercase in the URL.
 


Write your reply...
Back
Top