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

  • Home
  • SEARCH
  • 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 8226311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:43:09+00:00 2026-06-07T15:43:09+00:00

This question is quite specific to the code i’m trying to use, 1st ill

  • 0

This question is quite specific to the code i’m trying to use, 1st ill admit I don’t know how to write in jQuery, I more hack/manipulate existing scripts but I will learn at some stage but I need a fix to a current problem.

Basically I have a simple tab layout that swaps out content, my issue is the content that I’m swapping out is generated from a CMS so the links inside #screen take you to a different page. What I would like to do is keep the content within the #screen div by either manipulating the a href or maybe its something I can only achieve with an iframe but id like to stay away from that if possible. Sorry if my explanation isn’t clear code below.

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <style>
    .content {display:none;}
    .tab {cursor:pointer; width:20%; float:left; text-align:center; color:#fff; padding:10px;}
    #screen {clear:both; padding:20px 0 0 0;}
    </style>
    <script>
    $(document).ready(function(){
    var $content1 = $('.content').first().clone();
    $content1.css("display", "block");
    $('div#screen').html($content1);
    $(".tab").live("click", function() {
    var $content = $(this).next('div.content').clone();
    $content.css("display", "block");
    $('div#screen').html($content);}
    );
    });
    </script>
    <div class="tab">
    Tab Title
    </div>
    <div class="content">
    <a href="toplevelpage/pageexample.html">Link</a><br />
    <a href="toplevelpage/pageexample2.html">Link2</a><br />
    <a href="toplevelpage/pageexample3.html">Link3</a>
    </div>
<div class="tab">
    Tab Title2
    </div>
    <div class="content">
    <a href="toplevelpage/pageexample.html">Link</a><br />
    <a href="toplevelpage/pageexample2.html">Link2</a><br />
    <a href="toplevelpage/pageexample3.html">Link3</a>
    </div>
<div id="screen">
</div>
  • 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-07T15:43:11+00:00Added an answer on June 7, 2026 at 3:43 pm

    To load content into a div you can use load() – http://api.jquery.com/load/:

    $('a').on('click',function(e){
        e.preventDefault();
        $('div.content').load($(this).attr('href'));
    });
    

    You’ll probably want to select those links with a class though, because otherwise every link on your page will load into content.

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

Sidebar

Related Questions

I know this question is quite basic but I am new to JQuery and
This is a very odd, and quite specific question. Ultimately I am trying to
This is quite a specific question, and I have had no luck on the
I know this question might sound quite silly, but I somehow found myself stuck
I know this question has been rised quite a lot of times, but then
I know this question might sound quite stupid, but I've tried my best and
I know how that question looks, but I'm quite serious. I am trying to
Looking at the related questions, I don't think this specific question has been asked,
This is quite a long shot, I know it's a question about a very
This question is specific to Adobe AIR ActionScript/Flash applications. I've spend quite some time

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.