Javascript iframe tabs

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • loco
    New Member
    • Nov 2008
    • 1

    Javascript iframe tabs

    I am trying to use iframes in a web page and I am trying to use a fucntion to load the new page into the iframe. how do I call the page from a linked tab and load it into the new frame.

    Code:
    function load(){
      
      document.getElementByID('frame').style.display='block';
    document.getElementById('frame').src = document.getElementById('a');
    }
    </script>
    Last edited by acoder; Nov 6 '08, 03:51 PM. Reason: Added [code] tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    JavaScript is case-sensitive, so the capital D should be lower-case: getElementById.

    The src property needs to point to a string URL, so get the property of the element, e.g. if the element is a link, the .href property.

    Comment

    Working...