How to Get a source from an Iframe on another page and refresh it

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • unitedgt
    New Member
    • Dec 2007
    • 2

    How to Get a source from an Iframe on another page and refresh it

    Hello all,

    I'm having trouble with this code. It works but every time I click on a link that resides on the page that loaded through the Iframe, it opens the page through the iframe, but refreshes back to the original source that loaded. Any suggestions?

    function getSource()
    {
    ifsrc=location. search.substrin g(1)
    idx1 = ifsrc.indexOf(" a=")
    anchorName = ifsrc.substring (idx1+2,ifsrc.l ength)
    ifsrc=ifsrc.sub string(6,idx1-1)
    document.getEle mentById('mainc ontent').src = ifsrc + "#" + anchorName;
    }

    I'm calling this function through an onload in the body
Working...