www.webdeveloper.com
Results 1 to 2 of 2

Thread: Why doesn't this function work in Internet Explorer?

  1. #1
    Join Date
    Mar 2010
    Posts
    701

    Why doesn't this function work in Internet Explorer?

    I wrote this simple function to load an iframe after the entire HTML loads. It works perfectly in Chrome, but not IE. In IE, the iframe does not load.

    Code:
    <body id="body" onload="load()">
    ...
    function load(){
      f = document.createElement('iframe');
      f.setAttribute('id','frame');
      f.setAttribute('src','<?php echo $link; ?>');
      f.setAttribute('frameborder','0');
      document.getElementById('body').appendChild(f);
    }
    Also, is the a better way to append the iframe?
    Last edited by narutodude000; 01-31-2011 at 10:37 PM.

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    It works for me in IE7 and IE8. Anyway, load is a JavaScript reserved words. Use another name for your function load().

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles