我想在 HTML5 中使用 polyfill 来使日期类型在 Firefox 中工作。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,
maximum-scale=1.0,user-scalable=no">
<title>better-dateinput-polyfill demo</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"
type="text/javascript"></script>
<script src="http://cdn.jsdelivr.net/webshim/1.12.4/extras/
modernizr-custom.js"></script>
<script src="//cdn.jsdelivr.net/webshim/1.12.4/polyfiller.js"></script>
<script>
webshims.setOptions('forms-ext', {types: 'date'});
webshims.polyfill('forms forms-ext');
</script>
</head>
<body>
<input type="date" />
</body>
</html>
我用了这个答案 How to get HTML 5 input type="date" working in Firefox and/or IE 10
这是演示,效果很好 http://jsfiddle.net/trixta/BMEc9/
但在我看来这个错误( 类型错误:a.support 未定义 polyfiller.js(第 1 行,第 1413 栏 )
最佳答案
您需要更新版本的 jQuery; support()
直到 1.3 才添加:http://api.jquery.com/jquery.support/
关于javascript - 想要使用 HTML5 的 Polyfill 来使日期类型在 Firefox 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25632093/