Reputation: 2916
I'm trying to make a really simple ajax request in jQuery from http://dev.example.com/shop/category
which looks like this:
$.post("http://dev.example.com/ajax/test.php", function(data) {
alert("loaded");
});
No response is returned and Firebug's Status field is blank. Chrome says "(canceled)".
The test.php works fine when I open it in the browser.
It's on the same domain so I don't think it's a cross-site issue (I've tried a relative path too).
Any ideas?
Upvotes: 0
Views: 1939
Reputation: 2916
It was because my script was doing something else without waiting for the result of the ajax request. I just used $.ajax
with async:false
and it worked! Thanks to everyone who commented.
Upvotes: 1