www.webdeveloper.com
Results 1 to 6 of 6

Thread: IE problem with cross domain iframe resize

  1. #1
    Join Date
    Jan 2010
    Posts
    13

    IE problem with cross domain iframe resize

    I'm using some javascript that senses the presence of an id on a page, creates an iframe containing cross domain content if it finds it and also resizes the iframe. It works great in FF, but IE stumbles if there's more than one iframe requested (especially IE6).
    If someone knows a better way to get IE to co-operate with this set up, I'd appreciate the help. An acceptable alternative would be to only create one iframe at a time (which IE can handle), by using a link to trigger the iframe creation. I just can't figure out how to get that to work.
    The cross domain resizer uses the frame manager trick, the rest is homespun.
    Code:
    <!--JS THAT RESIZES IFRAMES-->
    <script type="text/javascript" src="documents/FrameManager.js"></script>
    </script>
    <!--POSTS-->
    <script>
    var post2 = document.getElementById('post2');
    if (document.getElementById('post2')) 
    {
    document.write('<iframe id="com2"  name="com2" class="comments" name="com2"  src="http://mysite.com/dOcuments/comments.html" onload="FrameManager.registerFrame(this)"  scrolling="auto" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible;  width:100&#37;;  "></iframe> '); 
     post2.appendChild(document.getElementById('com2'));
    }
    </script>

  2. #2
    Join Date
    Feb 2010
    Location
    England
    Posts
    122
    I don't believe I can help much, other than to suggest using percentages instead of pixels for the iFrame size.

    I personally used iFrames for a while, but due to their lack of usability, they are terribly impractical, and I would suggest not using them and looking for something else that does what you want.

    If you are looking to include just a section of information from another page, rather than load an entire page within the iFrame, you may want to reseach the #include command.

    If not, there is some information about alternatives to iFrames here.

    Sorry if that didn't help.

  3. #3
    Join Date
    Jan 2010
    Posts
    13
    Hazel,
    Thanks for responding. Unfortunately we can't use php or any kind of server side scripting with this particular project. Iframes do the job and you can see in Firefox the iframe id's and sizes being run in the address bar, but IE gets stuck and just bounces between two id's endlessly and never completes the resize script. It works fine with only one iframe but that's not an option, unless we use a link to create and resize one iframe at a time.
    I should add we have access to the source site.

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654

  5. #5
    Join Date
    Jan 2010
    Posts
    13
    Hey Fang,
    The resize script I was using is the same thing, but now doesn't appear to work in FF or IE!
    Last edited by avdistribution; 02-01-2010 at 12:40 PM.

  6. #6
    Join Date
    Jan 2010
    Posts
    13
    Ok, it's the exact same script but I must have messed something up when I uploaded it again. Back to sqaure one-works in FF, not in IE.

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