IE11-仅提交错误 [英] IE11-Only Submit Bug

查看:75
本文介绍了IE11-仅提交错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在页面上有一个表单,简单如下:

I have a form on a page, something simple like:

<form action="form/submit" method="post">
    <button type="submit">Submit</button>
</form>

它适用于每一个浏览器,包括旧版本的IE,但在IE11中它失败了,标签卡在连续加载循环中,在提交后永远不会更改为谢谢页面。但是,如果我打开控制台,它就可以工作了。

It works in every single browser, including older versions of IE, BUT in IE11 it fails, with the tab stuck in a continuous loading loop, never changing to the "thank you" page after submission. HOWEVER, if I open the console, it DOES work.

我知道IE已经使用的console.log问题,并且已经在使用:

I'm aware of the console.log issues IE has, and already am using:

if (!window.console) {
    console = {
        log: function() {}
    };
}

以避免它,这似乎做得很好(如上所述,其他所有IE工作)。关于问题可能在哪里的任何见解?

to avoid it, which seems to be doing fine (as mentioned, every other IE works). Any insight as to where the issue might lie?

推荐答案

当表单只有没有<$ c的输入元素时出现问题$ c> name 属性(或没有输入元素)。我在这里找到了对这个bug的引用,虽然它也发生在桌面模式而不仅仅是地铁模式,因为链接声称:

The problem appears when a form only has input elements without a name attribute (or no input elements). I found a reference to the bug here, though it also happens in desktop mode and not just metro mode as the link claims:

http: //connect.microsoft.com/IE/feedback/details/807447/ie-11-metro-version-submitting-form-fails-if-input-tag-has-no-name-attribute

修复方法是创建一个虚拟< input type =hiddenname =dummyvalue =something> 在提交表单之前的字段(具有名称和值集)。

The fix is to create a dummy <input type="hidden" name="dummy" value="something"> field (with a name and value set) before submitting the form.

该错误发生在IE11提供的所有兼容模式中。

The bug happens in all compatibility modes offered by IE11.

这篇关于IE11-仅提交错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆