IE9 下的 Jquery Ajax 问题

发布于 2024-12-12 03:45:24 字数 651 浏览 1 评论 0原文

我使用下面的代码使用 jquery 和 ASP.net 调用页面方法

$.ajax({
    type: "POST",
    url: url + "/" + method,
    contentType: "application/json;",
    data: jData,
    async: true,
    success: function (res) { if (succ) { succ(res); } },
    error: function (xhr, status, error) {
        NTF.Notify(NTF.GENERIC_ERROR);
        if (err) {
            err(xhr, status, error);
        }
    }
});

一切都工作正常,直到我将以下元标记引入到我的页面以便 css 半径与 IE9 一起使用

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

现在代码运行,它输入success 函数,但随后页面刷新,我不知道是什么原因导致的,代码在 Chrome、FF 和 IE 中运行良好,没有那个元标记。

有什么想法吗?

I was using the following code to call a page method using jquery and ASP.net

$.ajax({
    type: "POST",
    url: url + "/" + method,
    contentType: "application/json;",
    data: jData,
    async: true,
    success: function (res) { if (succ) { succ(res); } },
    error: function (xhr, status, error) {
        NTF.Notify(NTF.GENERIC_ERROR);
        if (err) {
            err(xhr, status, error);
        }
    }
});

Everything was working fine, till i introduced the following meta tag to my pages in order for the css radius to work with IE9

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

Now the code runs, it enters the success function, but then the page refreshes, I have no idea what's causing it, the code works fine in Chrome, FF and IE without that meta tag.

any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

给我一枪 2024-12-19 03:45:24

Is your meta tag before you import JQuery? This blog post seems to indicate that you can run into weird cases when you declare a meta tag after JQuery. It specifically talks about charset, but may be related to your problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文