1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Javascript + Iframe problem

Discussion in 'JavaScript' started by Drazen1, Oct 2, 2007.

  1. #1
    Hi everyone,

    Here is a problem that I have.

    In the page I call Iframe through Javascript (have to because of tracker).
    <div id="gads1"></div>

    document.getElementById('gads1').innerHTML ="<iframe name='google_ads_frame' id='google_ads_frame' src='http://mysite.com/iframe_file.htm'></iframe>";

    that file contains javascript giving 2 variables.
    I need each of those 2 variables to be written out in a separate DIV layers on the parent page.

    How can I access the variables in the iframe document to write out in separate places in the main (parent) document?

    if it was ordinary Iframe - no problem.
    But this is javascript calling IFrame and the usual approach doesn't work.

    I appreciate any suggestions.

    ~Drazen
     
    Drazen1, Oct 2, 2007 IP
  2. Logic Ali

    Logic Ali Well-Known Member

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #2
    If you are saying that the iframe isn't addressable, it will be because it was generated using innerHTML. Try creating it using DOM functions.
     
    Logic Ali, Oct 2, 2007 IP