简体   繁体   English

$('html')。append()在IE7上不起作用

[英]$('html').append() doesn't work on IE7

I need to insert a div in the DOM after the "html" tag. 我需要在“ html”标记后的DOM中插入div。 It works on all browser except in IE7. 它适用于除IE7之外的所有浏览器。

After several test, it looks like i can't access to the html element with IE7. 经过几次测试,看来我无法使用IE7访问html元素。

For example : 例如 :

$('html').append('mycontent'); //works with all browser except IE

Someone have an idea of how I can bypassing this IE7 limitation ? 有人对我如何绕过IE7的限制有所了解?

Thank you. 谢谢。

ps: I test on IE9 in IE7 mode ps:我在IE7模式下测试IE9

<html> is the root element. <html>是根元素。 Aside from the DOCTYPE, there should be NO nodes outside it, and it should contain only TWO nodes, <head> and <body> . 除了DOCTYPE之外,它外面应该没有节点,并且应该只包含两个节点<head><body> You should append new nodes to the <body> , maybe to the <head> if relevant, but never to the <html> itself. 您应该将新节点附加到<body> ,如果可能的话,可能附加到<head> ,但是不要附加到<html>本身。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM