RE: dynamic generation of iframes and writing to them

"Maninder, Singh" <[email protected]> Fri, 30 Jun 2006 00:29:48 +0530
Newsgroups gmane.comp.web.dom.wdf
Message-ID <4D8B620F4FDA414982B23A3E7F6A8EF1134093EC@hydmail01.hyd.corp.int.untd.com>
Thanks Ian.
 
But, I probably need more clarity on that.
 
I can't issue multiple calls to the ad server.
 
So, I send one request and ask for responses for different ad positions.
 
The server send me -
 
if (pos = A) {
  document.write(blah)
}
if (pos=B) {
  document.write("<iframe ...");
}
if (pos=C) {
  document.write(function setcookie..)
}
 
As you can see there are different types of responses for different positions.
 
From this one response I'll create the various positions (in iframes) and copy over the responses into them.
 
Hope this gives a clearer picture.
 
So, any more thoughts?
 
Thanks in advance,
Mandy.

________________________________

From: [email protected] on behalf of Ian Petersen
Sent: Thu 6/29/2006 11:18 PM
To: [email protected]
Subject: Re: [wdf-dom] dynamic generation of iframes and writing to them



As I understand it, you had the system working when you request the ad
and display it inline, but it sometimes screws up your display.

What if you create a page that contains nothing but the code to
request an ad? Then you could statically include an IFRAME that
refers to this new page. This way you don't have to dynamically
create anything except the ad itself, which you already had working,
and you still insulate your main content from the ad's code.

Ian

On 6/29/06, Maninder, Singh <[email protected] <mailto:mandiv%40corp.untd.com> > wrote:
> Anyone?
>
>
> -----Original Message-----
> From: [email protected] <mailto:wdf-dom%40yahoogroups.com>  [mailto:[email protected] <mailto:wdf-dom%40yahoogroups.com> ]On Behalf Of Maninder, Singh
> Sent: Thursday, June 29, 2006 12:55 PM
> To: [email protected] <mailto:wdf-dom%40yahoogroups.com> 
> Subject: [wdf-dom] dynamic generation of iframes and writing to them
>
>
>
> Hello Everyone,
>
> I would like to get some suggestions on a problem I am trying to address.
>
> - I send a request to a 3rd party server (for ads) and a response is received from them.
> - Currently, I display it inline on the page and things work fine but page loading is slow and the 3rd party response can mess up styles, js on my page.
> - So, I want to capture this response and dynamically generate iframes and write the response into that. This way the other site wont mess up things on my site.
>
> Now, the response is not always a simple plain gif, it could be an iframe with lots of stuff happening or it could be a URL that further calls some other ad.
>
> So, this is what I did -
>
> - Send a request to the server while the page is loading
> - Capture the response by overwriting default document.write() because otherwise it would open a new output stream.
> adContainer = "";
> document.write = function(text){
> adContainer += text;
> };
>
> - Then dynamically create the iframe -
> function generateIframe(iframeId, sDocument) {
>
> var tFrame = document.getElementById(iframeId);
> var doc = tFrame.contentDocument;
> if (doc == undefined || doc == null)
> doc = tFrame.contentWindow.document;
> doc.open();
> doc.write(sDocument);
> doc.close();
> }
>
> setTimeout("generateIframe('Left', adContainer)", 500);
>
> Now, this works fine when I am trying to get one ad position.
>
> Add to this a situation when I want to get 5 ad positions.
>
> So, I send only ONE request.
>
> Parse the response for different positions.
>
> Create an iframe each for the positions (so like 5 iframes) and then write the responses into them.
>
> I want to know if this is the right way to do it? Sometimes when the responses are overly complicated with functions, comments, cookies, blah blah the ad doesn't display.
>
> Please let me know your thoughts.
>
> Thanks,
> Mandy.
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Unsubscribe
> [email protected] <mailto:wdf-dom-unsubscribe%40egroups.com> 
>
> List info
> http://www.quirksmode.org/dom/list.html <http://www.quirksmode.org/dom/list.html> 
> Yahoo! Groups Links
>
>
>
>
>
>
>
>

-- 
Tired of pop-ups, security holes, and spyware?
Try Firefox: http://www.getfirefox.com <http://www.getfirefox.com/> 


 


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/9rHolB/TM
--------------------------------------------------------------------~-> 

Unsubscribe
[email protected]

List info
http://www.quirksmode.org/dom/list.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wdf-dom/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/