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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:07:00+00:00 2026-05-23T01:07:00+00:00

What I’m trying to do is setup a fairly standard sort of layout –

  • 0

What I’m trying to do is setup a fairly standard sort of layout – header, menu on left and main body on the right and keep it compatible with IE, FF and Chrome!

For the menu I wish to use an acordion style menu – I settled on this one here as it seemed very light weight, worked nicely and is very easy to edit menu items.
http://www.i-marco.nl/weblog/jquery-accordion-menu/

As you would expect from this layout clicking a menu option will have the information display on the right.
Now there are a few ways I could probably do this, but the option I want to use is inserting html in to a <div>.
For this menu it uses <a> tags – getting them to load a html in to a div tag is my first problem here. I have a little code, courtesy of a friend, that I believe should intercept the <a href>’s and then insert the linked html into the div tag.
Unfortunately it doesn’t seem to work and I was hopeing a kind soul here might take pitty on a noob and shed some light for me! 🙂

So here is the very basic code I would have in my index.html

<script type="text/javascript" charset="utf-8" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<script type="text/javascript" charset="utf-8">
/* <![CDATA[ */
function initMenu() {
    $('#menu ul').hide();
    $('#menu ul:first').show();
    $('#menu li a').click(function(){
        var checkElement = $(this).next(),
            href = $(this).attr('href');

    if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
      return false;
    }

    if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
        $('#menu ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
    }

    if (href != '#') {
        $.get(href,function(data){

            var inserting = $('body',data).html();

            $('#TEST').fadeOut('fast',function(){
            $(this).html(inserting);
            }); 
        });

      return false;
    }

  });
}
$(document).ready(function() {initMenu();});
/* ]]> */
</script>

<ul id="menu">
    <li>
        <a href="#">Weblog Tools</a>
        <ul>
            <li><a href="text.html">Simple Text</a></li>
            <li><a href="s2000.html">S2000 Info</a></li>
            <li><a href="local_link.html">Typo</a></li>
        </ul>
    </li>

    <li>
        <a href="#">Programming Languages</a>
        <ul>
            <li><a href="local_link.html">PHP</a></li>
            <li><a href="html/text.html">Ruby</a></li>
            <li><a href="local_link.html">Python</a></li>
            <li><a href="local_link.html">PERL</a></li>
        </ul>
    </li>
</ul>

<div id="TEST">
Content should replace this text.
</div>

simple text html to load into div
text.html

<html>
    <body>
        <p><h1>simple text</h1></p>
        <p>Lorem ipsum dolor sit amet, vim ut diam nulla admodum.</p>
        <p>Eum eu odio movet, nusquam deleniti ut his, usu te eius tamquam.</p>
        <p>blah
        <br />
        de-blah
        <br />
        ...
        </p>
    </body>
</html>
  • 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-23T01:07:01+00:00Added an answer on May 23, 2026 at 1:07 am

    It’s hard to answer your question without seeing any examples of the html files referenced in your hrefs, but a few things occur to me:

    In this line…

    var inserting = $('body',data).html();
    

    … it looks like your intention is to extract some html from the returned data, but that syntax isn’t right. You actually don’t even need to store anything (more on that later).

    Here…

    $('#TEST').fadeOut('fast',function(){
    

    … you’re telling the #TEST div to hide once its data is inserted. Is that really what you want?

    It’s possible that the get() function isn’t correctly interpreting the datatype, so you should explicitly set it. If you’re just trying to insert the contents of an html document into the #TEST div, all you have to do is the following:

    $.get(href,function(data){
      $('#TEST').html(data);
    }, "html");
    

    If that still doesn’t work for you, clarify the problem, and include a sample html file referenced in your hrefs.

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

Sidebar

Related Questions

I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a text area in my form which accepts all possible characters from
I am writing an app with both english and french support. The app requests
I'm parsing an XML file, the creators of it stuck in a bunch social
I am using Paperclip to handle profile photo uploads in my app. They upload

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.