ie11 也不兼容 html5 吗?

2015-09-14 22:28:46 +08:00
 pc10201
用 django 做了一个网站,注册表单中的一段代码

<input name="password" title="长度要求在 6-20 位" class="Text_Box" id="reg_userpass1" required="" type="password" size="30" pattern=".{0}|.{6,20}">

在 chrome 下运行良好, ie11 就会报密码长度错误,即使长度是正确的

ie11 不兼容 html5 吗?
4409 次点击
所在节点    程序员
18 条回复
ooxxcc
2015-09-14 22:31:28 +08:00
2015813
2015-09-14 22:40:55 +08:00
ie 越来越垃圾了、微软过不了几年就要倒了、看看 chorme 、 firefox 、 360 、搜狗虎视眈眈。
pc10201
2015-09-14 22:47:15 +08:00
@ooxxcc 上面写的是兼容的啊
RAKE
2015-09-14 22:57:42 +08:00
@2015813 完全忽视 Edge 啊。。
xfspace
2015-09-14 23:14:32 +08:00
@2015813 微软倒了,你后面说的除了 chrome 外,都不复存在了...
Wangxf
2015-09-14 23:21:30 +08:00
html5 压根就是移动玩的, pc 还是算了吧
muzuiget
2015-09-14 23:27:08 +08:00
IE 每一代都吹牛逼,更遵循标准云云,但实际上用起来无数这种细节问题。
FrankFang128
2015-09-15 00:46:04 +08:00
名字里带版本号的浏览器都是垃圾。
wwqgtxx
2015-09-15 07:11:28 +08:00
不是还有 edge 么
ixiaohei
2015-09-15 08:50:36 +08:00
为什么要用 ie11 呢,微软现在多 ie 都不做功能更新了
anubiskong
2015-09-15 10:12:02 +08:00
@Wangxf 移动的话支持的更烂, 不仅核心, 随便换一个浏览器体验都不同
FFLY
2015-09-15 10:13:06 +08:00
@xfspace Firefox 被你吃了啊……
iugo
2015-09-15 10:18:55 +08:00
猜测: 是不是 meta 中没有标记 edge 导致 IE 使用了兼容模式, 比如 IE7 去渲染.
weiceshi
2015-09-15 10:31:48 +08:00
槽点太多,不知道如何吐起
1 ,首先是你的正则表达式,.{0}|.{6,20},这是什么意思啊,匹配空字符或者 6-20 长度的任意字符?你自己念念,能念通吗?
2 ,其次 pattern 不应该处理空字符
The empty string is considered valid (no misMatch ) unless the required attribute is present as well (valueMissing ).
3 , required="" ......
4 , ie 从 10 开始就支持 pattern 了,不完全支持 input pattern 的移动浏览器包括 android 和 mobile Safari ,而桌面浏览器只有 Safari Safari Safari
Android, Safari and Mobile Safari support the pattern attribute, but do not support form validation, so will not prevent an incorrect value from being submitted, but do support the UI pseudoclasses.

最后,你的这段修改如下:
<input name="password" title="长度要求在 6-20 位" class="Text_Box" id="reg_userpass1" required type="password" size="40" pattern=".{6,20}">
weiceshi
2015-09-15 10:39:32 +08:00
xfspace
2015-09-15 10:47:28 +08:00
@FFLY Firefox 好像没桌面系统吧...我记错了?
599316527
2015-09-15 10:53:04 +08:00
pattern attribute 從 IE 10 開始支持的
https://msdn.microsoft.com/en-us/library/Hh772941 (v=VS.85 ).aspx
FFLY
2015-09-15 11:03:28 +08:00
@xfspace Linux 也有 Firefox ,而且我们讨论的不是浏览器吗?

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/220707

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX