I have a bookmarklet storing a lot of DOM data, but I would love to avoid to put them out of the body tag so the script in the page won't mess with it.
Semantic value is not an issue for once, but I would like to know :
- will it trigger some browser behaviour ?
- will it still be accessible in the D开发者_如何转开发OM ?
- can I display it using absolute positionning or should I move it to the body every time ?
Everything inside the <html> tag (even if outside the <body> tag) can be accessed via document.documentElement
.
Result of some little testing :
- Firefox won't display a big red DIV if it's after
</body>
- Firefox won't run
alert()
from a SCRIPT if it's after</body>
- Firebug don't see them but display the famous Firebug DIV after
</body>
精彩评论