468,514 Members | 1,121 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

iFrame.onload not working

my JS code

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function set(){
  3.     frames['hf'].onload = function(){
  4.         alert('yahooo!!!');
  5.     }
  6.     window.setInterval(function(){
  7.         frames['hf'].location.href = 'undefined_page.html';
  8.     }, 5000);
  9. }
  10. </script>
  11.  
and my HTML code is
Expand|Select|Wrap|Line Numbers
  1. <body onload="set()">
  2. <iframe name=hf ></iframe>
  3. </body>
  4.  
my iFRame.onload function not working. please help!
Nov 18 '11 #1
1 2420
acoder
16,027 Expert Mod 8TB
Change the location using the "src" property:
Expand|Select|Wrap|Line Numbers
  1. frames["hf"].src = ...
Nov 21 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by khothikhe | last post: by
reply views Thread by dimepiece18 | last post: by
5 posts views Thread by yawnmoth | last post: by
7 posts views Thread by Tom Cole | last post: by
3 posts views Thread by whatever0 | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.