I wrote a function in jquery and it works perfectly on localhost with the same setting
$('#resumey_graduation_add').live("cl开发者_如何学编程ick",function(){
var dataString=$('#job_form').serialize();
$.ajax({
type: 'GET',
url: 'app.php?name=job&op=resumey_graduation_add',
data: dataString,
cache: false,
beforeSend: function() {
$("#resumey_graduation_showall").html("<img src='images/loading.gif' />");
},
success: function(data2) {
$("#resumey_graduation_showall").html(data2);
}
});
return false;
});
but when moving it on my host , its not working and failed to load the data .
loading shows but not the result !
jquery versions are all tested and none of them worked
is there anything wrong , for expample not having JSON enabled or these things that are related to serialize() in jquery ?!
Since you are doing
type= get , data= $('#job_form').serialize(), url=Someurl.php?a=b&c=d
your url must be getting converted to Someurl.php?a=b&c=d&props_from_form(name value pairs)
Do this way
$.ajax({
type: 'POST',
other things ....
sending form through GET
may result in very big urls and that may get ignored by server.
精彩评论