Ajax请求在IE10中重新加载页面

时间:2016-05-24 11:19:56

标签: javascript ajax

我读到IE10 +能够像所有其他浏览器一样正常进行跨域操作,但在我的情况下似乎不起作用。

当我启动请求时,IE只是重新加载页面。

ajaxreq = $.ajax({
    postData = {"movie":movie, "season":season};
    url: "/cgi-bin/find_data.py",
        type: "post",
        datatype:"json",
        cache: false,
        async : true,
        data: postData,
        success: function(response){
           var json = $.parseJSON(response);
        }
    })
    .fail(function(err) {
        alert("error" + err);
    });

XDR也是如此,但只有在我关心IE< 10时我才需要这样做。

1 个答案:

答案 0 :(得分:0)

有两种解决方案:

  1. 将按钮的输入类型从提交更改为按钮
  2. 添加return false;在onclick事件中