iFrame.onload not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Debasis Jana
    New Member
    • Mar 2011
    • 4

    iFrame.onload not working

    my JS code

    Code:
    <script type="text/javascript">
    function set(){
    	frames['hf'].onload = function(){
    		alert('yahooo!!!');
    	}
    	window.setInterval(function(){
    		frames['hf'].location.href = 'undefined_page.html';
    	}, 5000);
    }
    </script>
    and my HTML code is
    Code:
    <body onload="set()">
    <iframe name=hf ></iframe>
    </body>
    my iFRame.onload function not working. please help!
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Change the location using the "src" property:
    Code:
    frames["hf"].src = ...

    Comment

    Working...