views:

30

answers:

1

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");
A: 

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 }
Peter Ajtai
Thank you million times! Soo... This solve the problem for Safari, but Chrome is still messing up something.
Matt
Any other ideas?
Matt
@Matt - No, sorry. I'm not sure what else it could be. Are you getting a `response` back at all, or it's just failing? Can you do other `.ajax()` methods on the site (`.post()` is just and `.ajax()` shortcut)? I'd start out with a simple case with no data being passes out and build up from there.
Peter Ajtai