SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2001
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy How can I link directly to an iFramed page?

    Here’s my dilemma I’ve just created a site containing a content iframe the problem that I have is that an external site would like to link directly to one of the iFrame pages. I could give them the direct link to the iFrame page but it would only link to that page and lose the entire nav etc. If there a script trick that I can do to link to the main index page and jump to the iFramed page that I need.

    Hope it makes sense it was pretty hard to explain!

    Cheers,

    dEVS!

  2. #2
    SitePoint Wizard LeoWebDesign's Avatar
    Join Date
    Nov 2002
    Location
    Central PA
    Posts
    1,146
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not totally sure what you are trying to achieve but if you want everything ("entire nav, etc.") on the page that has the iFrame to be seen then they would simply link to that page, not the one inside the frame.

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2001
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry I probably did not explain it very well – Lets try again…

    I want to have an external link that loads my site with a specific page in the iframe? rather than the default one.

    Hope that makes a little more sense?

    Thx!

  4. #4
    SitePoint Wizard silver trophy
    Join Date
    May 2003
    Posts
    1,843
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'll need to script this.
    Code:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
        "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    <head>
    <title>untitled</title>
    <script type="text/javascript">
    
    onload = function()
    {
    	var Qstr = location.search.substring(1);
    	if (Qstr != '')
    		document.getElementById('foo').src = unescape(Qstr);
    	else document.getElementById('foo').src = 'http://www.google.com';
    }
    
    </script>
    </head>
    <body>
    <iframe id="foo" width="600" height="460" src="about&#58;blank"></iframe>
    </body>
    </html>
    
    <a href="index.html?some_url_here">link</a>
    ::: certified wild guess :::

  5. #5
    SitePoint Zealot
    Join Date
    Apr 2001
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    great many many thanks for that! Just what I needed!

    Cheers,

    dEVS!


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
  •