获取head元素
先上一段jquery 1.7.1版本的代码片段:if(s.crossDomain){ var script, head = document.head || document.getElementByTagName("head") || document.documentElement; ........................}
有很多的人可能没有见到过 document.head 这样的方式获取head元素。
------------------------------ 这个是html5 HTMLDocument 接口开始支持的。
http://dl.iteye.com/upload/attachment/0073/9395/3434c092-5933-3596-9fdd-66636bd7e48c.png
浏览器支持情况:
[*]IE 6|7|8都不支持
[*]IE9支持
[*]高级浏览器都支持
页:
[1]