iamnoah / writeCapture

Utility to assist the Ajax loading of HTML containing script tags that use document.write. Mailing List: http://groups.google.com/group/writecapturejs-users
http://iamnoah.github.com/writeCapture
Other
241 stars 38 forks source link

Two ads on a page causing type error #42

Closed cgwin closed 12 years ago

cgwin commented 12 years ago

Hello,

Thanks for making this super helpful library. I am running into a bit of a weird issue.

When I have two ads on a page and run write capture I am getting a Uncaught TypeError: Object # has no method '2' and Uncaught TypeError: Object # has no method '3' with the following stack output

globalEval reffering to - head.insertBefore( script, head.firstChild );

global.writeCaptureSupport.replaceWith reffering to - globalEval(scripts[i]);

html reffering to - $.replaceWith(context.target,sanitize(markup,safeOpts(options),queue,context) + (cb || ''));

captureAndResume reffering to - html(uncapture(state),

script.onload.script.onreadystatechange reffering to - success();

I am using the no-lib library with the tool. I have also tried with the jquery plugin and I am getting the same error. If I switch the order of the ads, the first one will always run and the second one will always fail. If I call the ads by themselves, both will load with writecapture but when both are present only 1 will load.

The writecapture code is being called like so function(settings){ console.log(settings) var adsrc = dartAdSettings.createDartTag(settings); var adhtml = ' Githubissues.

  • Githubissues is a development platform for aggregating issues.