适用于 ie7、ie8 和 ie9 的最佳占位符 polyfil 脚本 [英] The best placeholder polyfil script for ie7, ie8 and ie9

查看:31
本文介绍了适用于 ie7、ie8 和 ie9 的最佳占位符 polyfil 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你推荐我使用哪个占位符 polyfill 脚本在 ie7、8 和 ie7 中提供占位符支持?9.

Which placeholder polyfill script do you recommend that I use to provide placeholder support in ie7, 8 & 9.

我已经看到了以下来自 Modernizer 的列表团队,想知道这里是否有人与他们或其他不在名单上的人有过一些合作,以及他们认为什么是最好的

I've seen the following list from the modernizer team and was wondering if anybody here had some mileage with them or any others not on the list and what they think is the best

我的评价标准是:

  • 文件大小
  • 无需现代化者即可工作
  • 速度(没有疯狂的循环)
  • 稳定性,它在野外使用了多少?
  • 检测原生占位符能力,不用费心运行

我记得有一天我曾经在输入的 onclick 事件中写一行左右的占位符支持 - 哈哈,但老实说我懒得支持这些可怕的浏览器(观看这个有趣的视频).至少 IE10 终于朝着正确的方向前进了.

I remember a day when I used to write a line or so in the onclick event of an input for placeholder support - lol, but to be honest I can't bothered to support these horrible browsers (watch this funny). At least IE10 is finally moving in the right direction.

谢谢...

推荐答案

我推荐你使用 jQuery Placeholder polyfill 来自 Mathias Bynens.

I recommend you use the jQuery Placeholder polyfill by Mathias Bynens.

  • 支持IE6+
  • 缩小了 2k
  • 它自己进行特征检测(不需要 Modernizr)
  • 代码很简单.jQuery 选择将因您的选择器而异
  • 它是 HTML5Please 推荐的一种 polyfill,并在 Modernizr Wiki 你提到的
  • 如果不需要,它不会执行代码
  • It supports IE6+
  • It is 2k minified
  • It does its own feature detection (Modernizr isn't needed)
  • The code is straightforward. The jQuery selection will vary depending on your selector
  • It is the one polyfill recommended by HTML5Please and is listed on the Modernizr Wiki you mentioned
  • It doesn't execute the code if it isn't needed

这篇关于适用于 ie7、ie8 和 ie9 的最佳占位符 polyfil 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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