Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7573465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:11:22+00:00 2026-05-30T16:11:22+00:00

I am using frames on index.html file. On every page of the frame I

  • 0

I am using frames on index.html file. On every page of the frame I have a code which checks if page is in frame, and if not, then redirect to index.html.

Now. I want to not only check if page is in frame and redirect to index.html, but also I want to open the page in one of the frames on index.html.

I have embedded the JS file with this code as of right now:

if (top.location == self.location)
{
    top.location = 'index.html'
} 

Is there any scripts you might know of?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:11:23+00:00Added an answer on May 30, 2026 at 4:11 pm

    You need to make the code in the subpages append their name to the ‘index.html’, e.g.

    if (top.location == self.location) {
        top.location = 'index.html?' + location.href;
    }
    

    …and put another Javascript on the index.html page which checks for the part after the question mark, e.g.:

    <script type="text/javascript">
    window.onload = function() {
      //check if a query string is given
      if (location.search && location.search.length > 1
           && location.search.charAt(0) == "?") {
    
          //load the URL to the frame
          window.frames["myframe"].location.href = location.search.substring(1);
      }
    }
    </script>
    

    By the way, you need to give your target frame a name like this:

    <frameset ...
        <frame name="myframe" ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a page index.html , how can I detect, using JS or
I am using the following code to force removal of surrounding frames on page
I having trouble in dividing the HTML frames. I have been using the following
I am using jquery autocomplete in an html page which is used as source
i'm trying to index an mp3 file with only one ID3 frame. using CLucene
i am using compact frame work for my windows mobile application in which i
Is there a way to break out of a frame using PHP? I have
I'm using a JEditorPane to display some HTML data, however any images that have
I'm using frames. My logo frame contains 2 pictures. One is 150px and other
I'm using an iframe which is added and removed from the page as needed.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.