jQuery ajax callback function not working
Posted
by
Harish Kurup
on Stack Overflow
See other posts from Stack Overflow
or by Harish Kurup
Published on 2011-01-15T06:08:49Z
Indexed on
2011/01/15
6:53 UTC
Read the original article
Hit count: 471
I am using Symfony PHP Framework to create web application, and using symfony Forms to create the HTML forms. I am trying to load the data in Select element using Ajax, for that i am using jQuery's Ajax functions. It is working fine as it sends and gets the response correctly(status as 200), but not calling the Callback function in some browsers such as IE,Chrome and Safari.It works fine in Firefox and Opera. the Code that is not working,
$.ajax({
type: 'POST',
url: 'form/ajax',
async: true,
cache: false,
dataType : 'json',
data: 'id='+ids,
success: function(jsonData){
alert("ok go");
}
});
the alert "OK Go" is not called in Chrome,IE and Safari But
$.ajax({
type: 'POST',
url: 'form/ajax',
async: true,
cache: false,
dataType : 'json',
data: 'id='+ids,
success: alert("ok go");
});
this works, but as per the project i want the JSON data to load in my Select element. is there any thing wrong in the return JSON format or the bug in the jQuery Ajax functions, please help.
© Stack Overflow or respective owner