开发者

jQuery ajaxSend() working in FF but not Chrome?

开发者 https://www.devze.com 2023-04-03 17:22 出处:网络
This code is working fine in FF but not in Chrome. sendRequest(); Calls a $.ajax() request. sendRequest(\'post\')开发者_C百科

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消