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);
}
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);
}