nolib: fixed scripts getting written to wrong part of page in Firefox 3.6.x #33

Closed
wants to merge 1 commit into from

2 participants

@brewt

globalEval() wasn't working properly in Firefox 3.6.x occasionally, so I pulled the latest version from jQuery 1.6.2. doc.write()'ed ads were getting inserted into the wrong part of the page.

@brewt brewt globalEval() wasn't working properly in Firefox 3.6.x occasionally, s…
…o I pulled the latest version from jQuery 1.6.2. doc.write()'ed ads were getting inserted into the wrong part of the page.
2f9f0c9
@iamnoah
Owner

globalEval should only be called for inline and same domain scripts. i.e., scripts you control. Can you not remove the document.write calls?

It is only calling globalEval() on inline and same domain scripts. Most of these scripts aren't using doc.writes, but it's the resulting scripts down the line which do the doc.writes. For example, we asynchronously load OAS ad code (which loads a function which does doc.write), and then call the functions using replaceWrite('#foo', ''). That inline script gets run with globalEval(). Not sure why, but in Firefox 3.6, that will sometimes result in the output of that being appended to the end of the document instead of replacing '#foo'.

Using jQuery 1.6.2's globalEval() code fixes it in Firefox 3.6 (it was fine in all other browsers [IE6-9, Firefox 6, Opera 11, Safari 5.1, Chrome 13]).

Owner

If you take a look at 0777b7e, this may be related to how we dynamically insert script tags. We should be inserting the script tag before the placeholder div.

@brewt

Sorry, busy with another project at the moment, but will revisit this issue later.

@iamnoah
Owner

Closing this issue. Feel free to reopen with a test case.

@iamnoah iamnoah closed this Oct 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment