• How to open page in frameset when page accessed

    Home » Forums » Developers, developers, developers » Web design and development » How to open page in frameset when page accessed

    Author
    Topic
    #396530

    I don’t know if this can be done, but I’m sure if someone would know, it would be one of you all!

    If someone goes to one of my pages via a search engine direct link, they end up on the page (“contents”) without the rest of the site’s frameset. This looks bad and makes navigation sloppy. I have added a link at the bottom of each page to load the main index.htm with frameset, however I also am trying to improve the following:

    —————————————————————-
    … added at the front to try to get this post-able


    … if (window.top==self) location.replace(“http://” + location.host);

    —————————————————————-

    That script checks to see if the page is in a frameset, and if not, bounces the visitor to the main entrance to the site.

    ???
    The QUESTION:
    ???

    Can I also somehow specify that the main navigation frameset load, with the designated page in the mainFrame contents frame?

    If you want to see what I’m trying to do, go to:

    http://www.synergest.com/faq.htm

    How can I get that page to reload itself into index.htm in the mainFrame contents frame? (I know I bungled the use of proper terms there, but hopefully you understand the gist of this…)

    I have gotten

    http://www.synergest.com/free-articles.htm

    to bounce to the top/main/entrance of the website, but then the visitor would be lost (e.g. where did that page go that they wanted to see?).

    Viewing 1 reply thread
    Author
    Replies
    • #743793

      I think it’s the same trick as your photo section:

      if (self.location == top.location) {
      top.location = “http://www.synergest.com/frameset.html?” + self.location;
      }

      And in the frameset, substitute the search parameter into the file name (defaulting to or refreshing to the home page if the parameter is missing).

      • #743805

        That’s what I am stuck on. I figured it had to be a variation of the Photos thing I asked about earlier… (I’m learning… really! )

        Within the index.htm:
        ———————————







        ———————————

        How to I substitute the variable for src=”home.htm” ?

        Thanks again for your help!

        • #743839

          Take a look at the script in post 308115, and follow the same idea to document.write the second tag.

          • #743897

            Okay. I’m almost there. Take a look at http://www.synergest.com/free-articles2.htm

            Notice the address bar. Something is over-compensating. The http://www.synergest.com/index-redo.htm has the modifications in it. One of them must be goofed up, obviously.

            So that I don’t mess up my Karma any more than it is, asking for your help on this second issue, can you send me (private, of course) an email with a real email for you, so that I can send you an Amazon.com gift certificate? Seriously. I appreciate your help, and don’t want to be free-loading…

            • #743906

              Oh wow, that’s the best offer I’ve had in two years. smile

              But let’s see if we can fix the page first. In the content page, I think I didn’t drill down enough when passing the URL. Try this:

                if (self.location == top.location) {
                top.location = “http://www.synergest.com/index-redo.htm?” + self.location.pathname;
                }
                [/list]That should give us the address relative to the domain. I guess this isn’t critical, but it will look neater. wink

                Then in index-redo.htm, it appears that there’s an extra ” just before the word mainFrame:

                document.write(“”);[/list]Does it help to delete that?
            • #743907

              Oh wow, that’s the best offer I’ve had in two years. smile

              But let’s see if we can fix the page first. In the content page, I think I didn’t drill down enough when passing the URL. Try this:

                if (self.location == top.location) {
                top.location = “http://www.synergest.com/index-redo.htm?” + self.location.pathname;
                }
                [/list]That should give us the address relative to the domain. I guess this isn’t critical, but it will look neater. wink

                Then in index-redo.htm, it appears that there’s an extra ” just before the word mainFrame:

                document.write(“”);[/list]Does it help to delete that?
            • #743910

              Scratch that, IE doesn’t seem to like script embedded in a frameset, so we have to drive the whole thing with script:

              document.write(“”);
              document.write(“

            • #743912

              Huh. I think that worked. I think I’m also catching on to the document.write thingy. Oh, how a little knowledge can be dangerous…

              Get thy email to me so I can get your Amazon cert to you. Or if you prefer something else, let me know. I’m serious! Thanks!!!

            • #743913

              Huh. I think that worked. I think I’m also catching on to the document.write thingy. Oh, how a little knowledge can be dangerous…

              Get thy email to me so I can get your Amazon cert to you. Or if you prefer something else, let me know. I’m serious! Thanks!!!

            • #743911

              Scratch that, IE doesn’t seem to like script embedded in a frameset, so we have to drive the whole thing with script:

              document.write(“”);
              document.write(“

          • #743898

            Okay. I’m almost there. Take a look at http://www.synergest.com/free-articles2.htm

            Notice the address bar. Something is over-compensating. The http://www.synergest.com/index-redo.htm has the modifications in it. One of them must be goofed up, obviously.

            So that I don’t mess up my Karma any more than it is, asking for your help on this second issue, can you send me (private, of course) an email with a real email for you, so that I can send you an Amazon.com gift certificate? Seriously. I appreciate your help, and don’t want to be free-loading…

        • #743840

          Take a look at the script in post 308115, and follow the same idea to document.write the second tag.

      • #743806

        That’s what I am stuck on. I figured it had to be a variation of the Photos thing I asked about earlier… (I’m learning… really! )

        Within the index.htm:
        ———————————







        ———————————

        How to I substitute the variable for src=”home.htm” ?

        Thanks again for your help!

    • #743794

      I think it’s the same trick as your photo section:

      if (self.location == top.location) {
      top.location = “http://www.synergest.com/frameset.html?” + self.location;
      }

      And in the frameset, substitute the search parameter into the file name (defaulting to or refreshing to the home page if the parameter is missing).

    Viewing 1 reply thread
    Reply To: How to open page in frameset when page accessed

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: