58 users online (0 members and 58 guests)  


  Results 1 to 4 of 4

Related

  1. Replies: 2
  2. Numbered lists--basic question    Forum: CSS Forum
    Replies: 1
  3. quick question about frames    Forum: HTML Forum
    Replies: 3
  4. question about targeting frames    Forum: HTML Forum
    Replies: 1
  5. frames question    Forum: HTML Forum
    Replies: 22
  1. #1
    istreamkc
    istreamkc's Avatar
    Guest

    Unhappy Basic question about Frames

    I am new to frames, (i know, almost unbelievable) but I need to link directly to a page in my site and pull the navigation frames up automatically. Is there a script or something that can do this? Again, here's the scenario:

    I link to www.myurl.com/legal.asp
    Instead of just legal.asp displaying, it also displays other pages in the other frames.

    Hopefully I have described it clearly enough. Thanks for any help!

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hiya. Welcome to the forums.

    Hmm. thats a tricky one.

    Is this an awful lot of pages, or just a one-off?
    If its a one-off, the easy way out would be to make another frameset that pulls up legal.asp as the default page.

    I get the feeling its going to be more than that, though. I can think of a JavaScript way that might work...tell you what, I'll go see if I can knock up a script, and if it works I'll post it here...
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Okay, heres a start -

    This script, placed in the HEAD of your stand-alone pages, will force it to load your default frameset -

    <script>
    if (parent.location.href == self.location.href){
    window.location.href = 'index.asp'
    }
    </script>

    Now, the problem here is that it doesn't load the original page into the main frame. So..
    I started messing about with php and came up with this awfully clumsy way of achieving this. I notice you seem to prefer asp (which I don't know nothing about), but if I outline the script you may be able to adapt it with asp...

    If, in the above script, you pass along a variable -

    window.location.href = 'index.asp?linked=yes'

    Then have in your frameset page a simple little script that picks this up and places the referring page in the frameset code (lol, i know, i know..). With php, you could do -

    Code:
    <frameset cols="100, *">
    	<frame src="index.php" name="left">
    	<frame src="
    <?
    if ($linked) {
    $page = $HTTP_REFERER;
    } else {
    $page = "your standard page.asp";
    }
    echo $page;
    ?>
    " name="main">
    	</frameset>
    lol. Clumsy as hell, but it does seem to work. Your only problem now it to make it work in ASP...

    (Someones gonna come along now and go 'or you could just do this ... with a one-line solution. just watch)
    Last edited by QuietDean; 11-28-2001 at 06:43 PM.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  4. #4
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    haha seams there would be a oneliner out there...but I won't be the person to tell you cause I don't know. Using the javascript and php makes it work...why not Makes you look smarter anyways



Tags for this Thread