targetting a div in one loaded page from another

Discussion in 'JavaScript' started by horevo, Oct 4, 2010.

  1. #1
    hi and thank you. i am new to this.

    on my main html page i have 2 divs. one has an id="col-A" and the other has an id="col-B"

    col-A has loaded into it 'page1.php' and col-B has loaded into it 'page2.php'.

    how can i target page1.php, or even the div col-A from inside page2.php ?

    i thought something like:
    window.parent.document.getElementByID('col-A').etc would work, but it doesn't seem to.

    any insights or help would be MUCH appreciated. thank you!
     
    horevo, Oct 4, 2010 IP
  2. krsix

    krsix Peon

    Messages:
    435
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you doing iframes or what? You're not allowed to poll other stuff.

    If you load with id.innerHTML/AJAX, then it might be doable (id's inside id's)
     
    krsix, Oct 4, 2010 IP