#3619 closed enhancement (wontfix)
$(document).ready waits for external js so everything waits for ads
Reported by: | filOtaz.de | Owned by: | flesler |
---|---|---|---|
Priority: | minor | Milestone: | 1.3 |
Component: | event | Version: | 1.2.6 |
Keywords: | Cc: | fil@… | |
Blocked by: | Blocking: |
Description
Ad distributors commonly provide js tags, that use document.write to inject new <script> tags, that inject new <script> tags and so on until finally some actual html is inserted. All these scripts use document.write() and are fully under control of the ad deliverer.
With $(document).ready waiting for all html to be parsed and the DOM build, everything waits for the whole chain loaded, which can be quite some time. Wrapping the tags in $(document).ready handlers makes things even worse: The document.write() is done in the global context and so overwrites the whole DOM. This results in only the ads shown.
This is a showstopper for using $(document).ready together with software like Openads or Companies like e.g. Adlink, Doubleclick and the like.
Possible remedy (?): Allow .ready() on subparts of the DOM, not only on $(document) in a way so that only completion of that subtree is waited for. to be used like:
<body>
<div id='site'> ... </div> <div id='ads'> ... </div>
</body>
---
$('#site').ready(function(){ ... });
Change History (3)
comment:1 follow-up: 3 Changed 15 years ago by
Component: | unfilled → event |
---|---|
Priority: | blocker → minor |
Resolution: | → wontfix |
Status: | new → closed |
comment:2 Changed 15 years ago by
This seems to be Gecko specific behaviour:
"If a document exists in the target, this method [document.open] clears it [...] Also, an automatic document.open() call happens when document.write() is called after the page has loaded, but that's not defined in the W3C specification."
For that, you can use the elementReady plugin.