Results 1 to 7 of 7

Thread: always open pages in the frame
      
   

  1. #1
    Jenny is offline Staff Sergeant
    Join Date
    Dec 2005
    Posts
    45

    Default always open pages in the frame

    I have one frame on my websit ewhich works great (thank you).

    But, if people type in the URL of one of my pages (as opposed to clicking on a link) it does not appear in the frame.

    I have been experimenting with Javascript to change this, but inserting the below code into the page always makes the frame's start URL open in the frame instead. Any ideas?

    <SCRIPT TYPE="text/javascript">
    <!--
    if (window == top) {
    top.location.replace("FRAMESET PAGE NAME HERE"); } //-->
    </SCRIPT>

  2. #2
    ez-ez is offline Special Status
    Join Date
    Mar 2006
    Location
    Australia
    Posts
    1,329

    Default Re: always open pages in the frame

    Hi Jenny.. Can you put the page URL here so we can have a look..?

    If I understand you correctly, you want someone to type in a page URL in the adress bar of their browser where they do not leave the page, but, the IFrame on that page would call the types URL.. is this correct..?

  3. #3
    Jenny is offline Staff Sergeant
    Join Date
    Dec 2005
    Posts
    45

    Default Re: always open pages in the frame

    Yes. But, also if they are on google.com or somehwere totally different. Then , they should be able to type in the URL and it should appear within the frame, rather than as a stand alone page.

    The URL is www.chemrefer.com/beta.htmkl - it is still in testing, everything works except don't type anything in the search box.

  4. #4
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: always open pages in the frame

    That is the down side of making a web-site using I-Frames as a primary navigation tool.

    One way around this is to make the Header of your web-site on top and the navigation menu horizontal. Then stretch your I-frame all the way across the web-page and place it under the header and Menu (800 width). Now make the links so that they appear in the I-frame. Now each page is independent and can be linked to seperately. When they do this- the main header and menu bar will be gone- but they can link to just that page. That is the trade-off.

    Getting to your main site can be accomplished by putting a "Return to Main Page" link on every page at the bottom.

    Hope that helps some.

    Andy
    PHP- is a blast!

  5. #5
    ez-ez is offline Special Status
    Join Date
    Mar 2006
    Location
    Australia
    Posts
    1,329

    Default Re: always open pages in the frame

    Quote Originally Posted by Jenny
    Yes. But, also if they are on google.com or somehwere totally different. Then , they should be able to type in the URL and it should appear within the frame, rather than as a stand alone page.

    The URL is www.chemrefer.com/beta.htmkl - it is still in testing, everything works except don't type anything in the search box.
    The answer you got from Andy above sums up the situation so accurately.. The solution he suggests is the most practical..

    The reason why your pages are not appearing I-Frame is simply because the I-Frame is not a component of those pages... Rather. it is a component of the page preceeding them, ie, Index page.. The problem as I see it is as follows:

    You need to be able to inorporate a command telling the visitor's browsers to display the page in I-Frame, more importantly, not just any I-Frame, but the I-Frame that is located at a particular page, ie, the Index page.

    This is possible, however, this would be a complicated script to write. If the URL was typed into a form which you have control of, it would be easy to have a PHP do this for you, however, you cannot direct another person's browser to a 'processing file' to display your pages in a certain style.. We now have to search for a way to achieve 2 things:

    1. A script that take any URL address to the index page.
    2. take the URL entered by the visitor and call that page into the URL.

    Perhaps, this is possible, but I have a feeling it will involve a lot of hard work and research.

    The above are only suggestions and you can start your search along these lines.

  6. #6
    Jenny is offline Staff Sergeant
    Join Date
    Dec 2005
    Posts
    45

    Default Re: always open pages in the frame

    I see. Thanks for your insights.

    The reason I ask was because I read this article which i shwere I got the code I mentioned: http://searchenginewatch.com/showPage.html?page=2167901

  7. #7
    Jenny is offline Staff Sergeant
    Join Date
    Dec 2005
    Posts
    45

    Default Re: always open pages in the frame

    OK, I know how to do it now.

    On the parent page I put my i-frame in with this code:

    <script language="javascript">
    // writes in the iframe
    contPage = (location.search.substring(1))? location.search.substring(1) : 'about.html';
    contPage = unescape(contPage);
    document.write('<iframe src="'+contPage+'" name="searchresultsframe" height="1221" width="670" scrolling="no" frameborder="0">');
    document.write('</iframe>');
    </script>

    Then on the 'orphan' pages which I want to only ever open in the i-frame I put this code between the head tags:

    <script>
    pageLoc = self.location; pageAdd = top.location; if (pageLoc == pageAdd) { contentSrc = escape(pageLoc); contPage = 'index.html?' + contentSrc; top.location.href = contPage; }
    </script>



Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49