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 9029111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:10:17+00:00 2026-06-16T07:10:17+00:00

I’m building a site and would like to be able to click a link

  • 0

I’m building a site and would like to be able to click a link in the navigation bar then when you click this link it’ll href to the main index page and at the same time change the source of an iframe on that index page. I hope that’s a clear enough idea of what I’m trying to do? The reason for this is because, as below, the community page will have a completely different page to it, however the rest of the site will be hosted directly from the index page but load into the main iframe on that page. Here’s the navigation (which I tried but does not work) which might make what I’m trying to do that much clearer:

div class="navbar"><!--start nav-->
<div class="nbutton"><a onclick="location.href='index.html'" href="home.html" target="mainframe">Home</a></div>
    <div class="nbutton"><a onclick="location.href='forum.html'" href="forum/" target="forumframe">Community</a></div>
<div class="nbutton"><a onclick="location.href='index.html'" href="events.html" target="mainframe">Events</a></div>
<div class="nbutton"><a onclick="location.href='index.html'" href="sponsors.html" target="mainframe">Sponsors</a></div>
<div class="nbutton"><a onclick="location.href='index.html'" href="gallery.html" target="mainframe">Gallery</a></div>
<div class="nbutton"><a onclick="location.href='index.html'" href="streams.html" target="mainframe">Streams</a></div>

Iframe on index.html page code:

<iframe name="mainframe" width="700" height="600" src="images/randoms/iframetest.jpg" frameborder="1" allowFullScreen="" style="background:transparent;text-align:center;"></iframe>

Iframe on forum.html page code:

<iframe name="forumframe" width="960" height="1200" src="forum/" frameborder="0" allowFullScreen=""></iframe>

I’m hoping this will make it easier to see what I’m trying to do with it?

When I click on any link other than the forum link the iframe won’t load but then again, the iframe on the forum.html is set to load the "forum/" location anyway so it doesn’t really need to onclick event it’s just there for uniformity I guess.

So summary example of what I’m looking to do:

Click on "Home" would load index.html then change the iframe source on index.html to "home.html"
Click on "Events" would load index.html then change the iframe source on index.html to "events.html"

I hope that makes sense?

Any help is greatly appreciated! Any further details please ask and I’ll try to clarify anything I’ve missed or that isn’t clear.

  • 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-06-16T07:10:18+00:00Added an answer on June 16, 2026 at 7:10 am

    You can pass index.html?subpage=home.html as the URL of the primary page and use JavaScript to read the subpage parameter to set the frame’s page.

    You can use the code below to read URL parameters. Lifted from this answer:

    var QueryString = function () {
      // This function is anonymous, is executed immediately and 
      // the return value is assigned to QueryString!
      var query_string = {};
      var query = window.location.search.substring(1);
      var vars = query.split("&");
      for (var i=0;i<vars.length;i++) {
        var pair = vars[i].split("=");
          // If first entry with this name
        if (typeof query_string[pair[0]] === "undefined") {
          query_string[pair[0]] = pair[1];
          // If second entry with this name
        } else if (typeof query_string[pair[0]] === "string") {
          var arr = [ query_string[pair[0]], pair[1] ];
          query_string[pair[0]] = arr;
          // If third or later entry with this name
        } else {
          query_string[pair[0]].push(pair[1]);
        }
      } 
        return query_string;
    } ();
    

    You can then access QueryString.c

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.