Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts

    deep linking to framed pages

    i have site which has one 'products' section which uses frames - the rest of the site does not use frames - here's my problem:

    is it possible to link to different pages in my frameset directly, as currently i seem to be able to only link to one default page within my frameset and then i have to browse to the original page i wanted within my frameset.

    e.g i have five links on my home page (a page that does not use frames) and 3 of those links need to link to 3 seperate pages in the framed section of my site - how do i do this? when i link directly it only shows the page - not the the other two frames (index on the left or the top part of my site).

    heres my home page - http://www.designermortgages.com/index.htm

    from the home page i would like to link to 2 or 3 pages in this framed section of my site - http://www.designermortgages.com/mor.../mortgages.htm

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Must be around here somewhere...

    KevinG,

    i don't have a direct answer to your question, but i know a similar question has been asked before and one of the forum members offered some clever javascript to solve this problem. It concerned linking to a frame from outside the site and the scripts took care of placing the linked document in the right frameset again.
    It probably was in the "HTML & CSS" forum, or maybe in one of the javascript forums, possibly in the old forums.
    I'm afraid you'll just have to do some searching on topics like linking to framesets, breaking a frameset, or something like that.
    Perhaps someone else has a better memory?

    The only other solution i can come up with is using dedicated framesets for each page. This causes an increase in documents to be created, and seems mute, but the real advantages of using frames still hold up. Also, it doesn't depend on javascript. It's your call...
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #3
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts
    still no luck with this problem.

    can anyone suggest a solution?

  • #4
    Regular Coder
    Join Date
    Oct 2002
    Posts
    380
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I did something like this ages ago. Basically, you embed a reference to the frames into the query string. You can then access this from javascript and load the pages to each frame as appropriate.

    I don't have time to dig up the acutal code right now, but it's not too hard to do.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    632
    Thanks
    1
    Thanked 21 Times in 21 Posts
    Add a query string to your link to indicate which page you're trying to get into the frames:

    &nbsp;<a href="fctl.htm?target.htm">Link</a>

    In the frame-control (fctl.htm) page, pick up the link:

    &nbsp;<script...>
    &nbsp;&nbsp;T=document.location.search.substring(1);
    &nbsp;</script>

    Make sure that you include a default just in case the link is missing:

    &nbsp;if (T=='') {T=default.htm;}

    Use the link thus obtained to write the frame control information:

    &nbsp;document.write('<frameset...');
    &nbsp;document.write('<frame src="'+T+'">');
    &nbsp;...

    See it in action at my web site. Go to the link below, click on the title of any page in the lower-right frame, notice that you've popped out of frames, navigate a bit using the upper arrows or lower buttons, then click on the "Return to Frames" link at the bottom of the page. You'll return to frames with that page in the lower-right frame.

    &nbsp;http://spruce.flint.umich.edu/~jalarie/
    Last edited by jalarie; 01-08-2003 at 04:56 PM.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    MSDN does something like that as well - you'll see their fully-qualified urls are basically

    http://.../somescript.asp?full-url


    When you load "full-url" page on its own, it has a script in it which reloads the page's parent frameset, parsing to it a reference to the pages which should be inside it. You could document.write the frameset, as jalarie suggested, or just dynamically change the frame srcs



    But my instinct - and my best advice to you - is don't use a frameset. What benefit does using frames bring you - there is probably a better way of acheving the same benefit.

  • #7
    Regular Coder KevinG's Avatar
    Join Date
    Aug 2002
    Location
    The Matrix
    Posts
    405
    Thanks
    3
    Thanked 0 Times in 0 Posts
    i decided to do it the safest way - i made each page into its own frameset - took me ages and was a bit complicated but at least it works.

    cheers guy


  •  

    Posting Permissions

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