+ Reply to Thread
Results 1 to 4 of 4

Thread: Iframe content loading in Div using JS: Works in FF not in IE6

  1. #1
    Barn Newbie Thomskint is an unknown quantity at this point Thomskint's Avatar
    Join Date
    Aug 2009
    Posts
    2
    Rep Power
    3

    Iframe content loading in Div using JS: Works in FF not in IE6

    Hi,

    so I have a JS function to display various content in a popup DIV.
    The user clicks on a link which displays a div containing an iFrame.

    When the JS function is called it writes HTML to the Div to include the iframe.
    See below for the part of the Javascript function which creates the code:
    Code:
    	vid_iframe_code = '<iframe src="' + urlDisplay + '" id="the_video_in_page" name="the_video_in_page" frameborder="0" marginheight="0" marginwidth="0" allowtransparency="yes" scrolling="' + scrolling +'" style="border:0px; border-style:none; width:'+ setWidth + 'px; height:560px; margin:0; padding:0;"></iframe>';
    		document.getElementById(ajax_show_page_holder).style.visibility = "visible";
    		document.getElementById(ajax_show_page_holder).style.display = "block";
    		document.getElementById(ajax_show_page_holder).style.top = ypos + "px";
    		document.getElementById(ajax_show_page).style.overflow = "hidden";
    		document.getElementById(ajax_show_page).innerHTML = vid_iframe_code;
    
    The Div code can be seen here:
    Code:
    	<div id="ajax_show_page_center">
    			<div id="ajax_show_page_holder">
    				<div id="ajax_inside">
    					<div class="boxAjaxTop"><h2>AIR 2 AIR Ltd.</h2><a class="buttonGo close right" href="javascript:// Close" onclick="javascript:A2AClose();"><b>Close</b></a></div>
    					<div id="ajax_show_page" class="clear"></div>
    					<div class="boxAjaxBottom"></div>
    				</div>
    		
    			</div>
    	</div>
    
    It works fine in IE 7 and FF but in IE 6 the actual iframe content is not displayed in the div. However if I right click and refresh the frame then everything works as it should.

    Does anybody have any ideas?

    cheers

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    What happens if you add the following AFTER the iframe is generated?
    Code:
    window.frames["the_video_in_page"].location.href=urlDisplay;
    
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #3
    Barn Newbie Thomskint is an unknown quantity at this point Thomskint's Avatar
    Join Date
    Aug 2009
    Posts
    2
    Rep Power
    3

    Thanks

    Cheers jmurrayhead, that worked a treat, thanks for the prompt reply!!!

  4. #4
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    Glad I could help, and welcome to DeveloperBarn
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread

Similar Threads

  1. Passing value between parent and IFrame
    By richyrich in forum .NET Development
    Replies: 5
    Last Post: August 13th, 2009, 12:33 PM
  2. javascript is not loading in calling page
    By guddu in forum ASP Development
    Replies: 4
    Last Post: July 21st, 2009, 03:33 PM
  3. Entire div as link over iframe: works in FF but not IE??
    By MaxxMills84 in forum HTML & CSS Help
    Replies: 9
    Last Post: July 1st, 2009, 03:07 PM
  4. Mask Page Content While Page Loading
    By BLaaaaaaaaaarche in forum JavaScript Programming
    Replies: 1
    Last Post: March 16th, 2009, 02:27 PM
  5. iFrame issues
    By marshmellow_man in forum ASP Development
    Replies: 2
    Last Post: September 30th, 2008, 10:21 AM

Bookmarks

Posting Permissions

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

SEO by vBSEO