大佬教程收集整理的这篇文章主要介绍了需要帮助:jquery prepend doctype to html,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
>我正在编辑应用程序的CSS样式表.
>我只能编辑CSS样式表(除非我可以创建性地使用CSS浏览另一个文件,或者可能在现有的.js中添加一个小的jQuery prepend语句)
>申请仅为ie6,ie7和ie8兼容.他们从不使用FireFox,也不是一种选择.
寻求帮助:
1)我认为我需要使用jQuery“prepend / prependTo”一个“doctype”
html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"
如果没有!doctype,它会将ie8抛入quirksmode,当然不接受任何样式,例如“input [type = checkBox]”
我以前没用过prepend.你能帮我解决一下如何制作以下内容的完整而正确的语法:
CURRENT:< html xmlns =“http://www.w3.org/1999/xhtml”lang =“en”xml:lang =“en”>
希望:< doctype html xmlns =“http://www.w3.org/1999/xhtml”lang =“en”xml:lang =“en”>
这对我来说还不起作用$(“html”).prepend(“doctype”)
<!DOCTYPE html> <html (xmlns or any other attributes you want)>
<!DOCTYPE不是元素.它有<!在开始时,对于元素无效.这是“doctype声明”,初始解析后无法进行有效修改. 即使在DOM接口允许您移动/替换表示doctype声明的DocumentType节点的浏览器上,这也不具有在Quirks和Standards模式之间进行更改的效果,这是仅在初始加载时决定的.您不能在模式之间改变文档. 您可以从现有文档加载新文档,但更改模式:
<!-- no doctype,loads in Quirks Mode (BACkCompat) --> <html> <!-- rest of the document,then at the end: --> <script> alert('Now in compatMode '+document.compatModE); if (document.compatMode==='BACkCompat') { setTimeout(function() { var markup= document.documentElement.innerHTML; markup= '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">'+markup+'</html>'; document.@L_944_12@; document.write(markup); document.close(); },0); } </script> </html>
但我强烈建议不要这样做.它很难看,会在加载时间结束时重置任何状态并重绘,并且会对脚本产生各种负面影响.
如果您想要标准模式,您确实需要将doctype添加到HTML本身.如果您绝对无法触摸该应用程序,那么如何使用ISAPI筛选器(假设您的Web服务器是IIS)将doctype添加到其HTML输出中?
以上是大佬教程为你收集整理的需要帮助:jquery prepend doctype to html全部内容,希望文章能够帮你解决需要帮助:jquery prepend doctype to html所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。