+ -
当前位置:首页 → 问答吧 → jquery的ajax()方法在IE下正常工作,但在firefox下不能正常工作

jquery的ajax()方法在IE下正常工作,但在firefox下不能正常工作

时间:2010-02-01

来源:互联网

我的IE是6.0,Firefox是3.5.7,jquery是最新版本的。
$.ajax({
  type: 'POST',
  global: false,
  url: "http://127.0.0.1:8000/ms/1/",
  data: "messagenum=3&name="+$('#name').val()+"&content="+$('#content').val()+"&checkcode="+$('#checkcode').val(),
  error: function(){
  alert('验证码错误!');
  $('#checkcode').val('');
  $('#checkimage').attr({src: "http://127.0.0.1:8000/get_check_code_image/?nocache="+Math.random()});
  },
  success: function(html){
      $('#name').val('');
      $('#content').val('');
      $('#checkcode').val('');
      $('#checkimage').attr({src: "http://127.0.0.1:8000/get_check_code_image/?nocache="+Math.random()});
    $("#results").html(html);
  }

});
}

在IE下这段代码正常工作,服务器看到提交的 方法也是POST
但是在Firefox下服务器看到提交的方法是"OPTIONS"
请问这是为什么。

作者: 1138465   发布时间: 2010-02-01

相关阅读 更多