SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast minus's Avatar
    Join Date
    Jan 2002
    Location
    Pittsburgh, PA, USA
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Mozilla problem : loading page in external frame

    Hello,

    I have two IFRAMES on a page. In one of them, I have a link which, when clicked on, triggers a page to be loaded in the other IFRAME. I cannot have that scheme working with Mozilla. Here is my code:

    parent window:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    	<title>Untitled</title>
    </head>
    
    <body>
    <iframe src="gee.html" width="200" height="100" id="procont" frameborder="1"></iframe>
    <iframe src="bar.html" width="200" height="100" id="profoot" frameborder="1"></iframe>
    
    
    </body>
    </html>
    gee.html
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    	<title>Untitled</title>
    	<script language=JavaScript>
    	function loadit() {
    	parent.profoot.location="bar.html";
    	return true;
    	}
    	</script>
    	
    </head>
    
    <body>
    <a href="#" onclick="loadit();">click</a>
    
    
    </body>
    </html>
    I can't see what's wrong and I have tried different syntaxes. It works with IE but not with Mozilla.

    Help very welcome ! Tks !

  2. #2
    SitePoint Enthusiast minus's Avatar
    Join Date
    Jan 2002
    Location
    Pittsburgh, PA, USA
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This actually is one mozilla bug. It is supposed to be fixed any time soon.

    There is a workaround:
    http://bugzilla.mozilla.org/attachme...99&action=view
    look for http://bugzilla.mozilla.org/show_bug.cgi?id=134323

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Instead of this
    parent.profoot.location="bar.html";

    try using this
    parent.document.getElementById('profoot').src="bar.html";

  4. #4
    SitePoint Enthusiast minus's Avatar
    Join Date
    Jan 2002
    Location
    Pittsburgh, PA, USA
    Posts
    77
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    True that works. You can actually access the frame location with its name or the frame src with its ID.

    Thanks man !


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
  •