This code is working fine in FF but not in Chrome.
sendRequest();
Calls a $.ajax()
request.
sendRequest('post')开发者_C百科
$('#status').ajaxSend(function() {
$(this).removeClass();
$(this).html('Posting...');
});
Any ideas why this wouldn't work in Chrome?
Interestingly if I put an alert()
at the end of the ajaxSend()
I the 'Posting...' is added to the div but if the alert isn't there it doesn't change.
Here's the $.ajax()
code as requested:
$.ajax({type: "POST",
url: "ajaxRequest.php",
data: varString,
dataType: "text",
async:false,
success: function(data){
if(data == "1"){
return true;
}
else{
return false;
}
});
Apparently I can't leave a comment, but I need to ask: did you leave the ); at the end out of your code? It looks like you ended the JSON set, but not the ajax method.
精彩评论