html5 新标签支持js写法
来源:互联网 发布:淘宝信用卡分期买手机 编辑:程序博客网 时间:2024/06/07 18:35
先上代码 用js创建新的标签元素,使ie支持html5新标签
<script type="text/javascript"><!-- (function() { if (! /*@cc_on!@*/ 0) return; var e = "abbr, article, aside, audio, canvas, datalist, details, dialog, eventsource, figure, footer, header, hgroup, mark, menu, meter, nav, output, progress, section, time, video".split(', '); var i= e.length; while (i--){ document.createElement(e[i]) }})() --></script>通过Jscript中@cc_on 语句识别IE浏览器及版本的代码
if(!/*@cc_on!@*/0) IE11一下执行此代码
If your browser doesn't know conditional compilation (other than IE
< 11), the expression will be:
if(!0) // ==> TRUE
otherwise it will be:
if(!!0) // ==> FALSE
/*@cc_on @*//*@ document.write("JavaScript version: " + @_jscript_version + "."); document.write("<br />"); @if (@_win32) document.write("Running on the 32-bit version of Windows."); @elif (@_win16) document.write("Running on the 16-bit version of Windows."); @else document.write("Running on a different operating system."); @end@*/
原文地址https://stackoverflow.com/questions/24473882/what-does-this-comment-cc-on-0-do-inside-an-if-statement-in-javascript
检测浏览器是不是ie的方法
阅读全文
0 0
- html5 新标签支持js写法
- HTML5 Shiv – 让IE支持HTML5的新标签
- 如何让旧浏览器支持HTML5新标签
- 如何让旧浏览器支持HTML5新标签
- 关于html5支持与否的判断(JS检测是否支持HTML5新特性)
- HTML5 META标签 标准写法
- HTML5新标签
- HTML5 中的新标签
- HTML5 新标签
- HTML5 新标签
- HTML5新标签
- HTML5新标签
- html5新标签
- HTML5 新标签
- Html5新标签注解
- html5新标签
- HTML5 中的新标签
- HTML5新标签
- mysql中的year(date)和date_format(date,format)的用法
- C语言中malloc()函数与alloc()函数简介
- stm32启动文件ld md hd cl vl xl分析及选择
- 正则表达式常用语法总结
- HttpClient用户指南 OverView
- html5 新标签支持js写法
- 关于WEB-INF目录的文件访问问题
- TexturePacker 拆解工具
- XRecyclerView下拉刷新,上拉加载
- 关于Linux的c编译器和汇编器
- 数学笔记14——微积分第一基本定理
- Http协议
- 4.Spring Cloud:服务消费(Feign)【Dalston版】
- leetcode_307.Range Sum Query