flunky needs help. Using JS for IFrames

Discussion in 'Javascript' started by Clyde, Jul 6, 2005.

  1. Clyde

    Clyde Guest

    I have some HTML ads on server #1 that I want to display on server #2.
    I don't have any control over server #2.

    I need to display this ads in iframes since they are complete HTML
    pages including embedded CSS info.

    Since iframes don't autosize, I want to create the IFrame tag using
    width and height values that change from ad to ad.

    What I have is a JS file on my server containing ad info (adUrl,
    adHeight, adWidth arrays). I have a function that builds a complete
    IFRAME tag using the properties for a random ad. The function is
    called witin a document.write() statement.

    When the page initially loads, the iframe displays properly. But when
    the page is refreshed and a different ad URL is chosen, the iframe's
    height/width changes correctly but the IFrame's src doesn't change
    (the previous ad's HTML page is shown).

    Same behavior in IE & Firefox.
    Clyde, Jul 6, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.