?Many have tried this. Most have failed. It's a much harder problem than it
seems on the surface. What you're seeing is probably that inside an iframe,
a new "window" object is created, meaning that document.write() reverts to
pristine. If that iframe is on a different domain (it often is), there's
almost nothing you can do to change this. And even if it's a local domain,
it's still really complicated to do cross-browser.
Also, keep in mind, several of the ad companies (like Google Ad-Words) have
explicit wording in their TOS that forbids such activities. I've never
delved much into this simply because I don't want to run afoul of such
wording and have my account canceled. Just some food for thought.
--Kyle
--------------------------------------------------
From: "Mads Erik Forberg" <[email protected]>
Sent: Wednesday, December 15, 2010 10:26 AM
To: <[email protected]>
Subject: [JSMentors] Async document.write
Hello,
have any of you worked out a async document.write that works with
ad-hosting-services?
My employer uses AdTech, and some times they load ads from yet another
ad-hosting-service, so we get many layers of document.write
It works fine for the first ad-service to do this stuff:
[code]
var oldWrite = document.write,
content = '';
document.write = function(d) {
content += d;
}
[/code]
But when the script from the AdTech loads, it loads yet another script
that uses document.write from another service. And that document.write
goes back to its old self.
Like this:
Initial call:
<script src="path-to-adtech.js"></script>
In that script its:
document.write("<script src=\"another-provider.js\"><\/script>");
And in that script:
document.write("Print out fancy ad");
So what I want is a document.write that stays persistant over all the
layers.
Anyone encountered this? Solutions? Hacks?
Best regards,
Mads Erik Forberg
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]