1
votes

Hello
I'm adding some ajax features to a site and I have very strange problem.
On webkit browsers the ajax request aren't working.
I have no idea where is the problem.
I noticed that if I leave only one ajax request the Safari(windows) is doing it right, but that its not what is happening to the Safari(Mac) and Chrome(windows).
The javascript console on firefox says that there are no errors.
Ah... i forgot to mention that I use jQuery(1.4.2) same on jQuery(1.4.3).
Does somebody have any idea what is happening?
Thank you!

Edit: Some code.

$.post("http://address-to-the/file.php", { action : "get_location", location : location.href }, function(response){
if(response.status == "OK"){
$("#main-menu").html(response.code);
}else{
alert(response.message);
}
}, "json");
1
You will need to show some code. - Pekka
I updated the main post. Thanks! - Matt
Is it a cross-origin request? Judging from the http:// example - Harmen
Note: The spelling is response not responce. - Peter Ajtai
@Harmen, No, I just type the full URL. - Matt

1 Answers

0
votes

You might be having some variable name clashes, since there's a window.location and one of your object property names is location, so try putting your object names in quotes:

{ "action" : "get_location", "location" : location.href }

instead of:

{ action : "get_location", location : location.href }