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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:02:01+00:00 2026-05-20T16:02:01+00:00

ive searched around but couldnt really find anything to help. I use this code

  • 0

ive searched around but couldnt really find anything to help. I use this code as a main ajax call for all content on my site (All content loaded dynamically into a div using this script):

jQuery(document).ready(function($) {
        function load(num) {
            $('#pageContent').html('<img src="imgs/ajax-loader.gif">') 
            $('#pageContent').load(num +".html");
        }

        $.history.init(function(url) {
                load(url == "" ? "1" : url);
            });

        $('#bbon a').live('click', function(e) {
                var url = $(this).attr('href');
                URLDecoder.decode(location,"UTF-8");
                url = url.replace(/^.*#/, '');
                $.history.load(url);

                return false;
            });
    });

which works great. its fantastic. however, i am unable to get default content displayed in the <div> on page load.. so a visitor would have to select a menu item before any content shows. Any ideas on how i could do this?

At the minute all i see is my loading animation.. I use jQuery with the History plugin.

  • 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-20T16:02:02+00:00Added an answer on May 20, 2026 at 4:02 pm

    Can’t you just set a default num and load it when your DOM is ready?

    var defaultnum = 1; //for example
    jQuery(document).ready(function($) {
        function load(num) {
            $('#pageContent').html('<img src="imgs/ajax-loader.gif">') 
            $('#pageContent').load(num +".html");
        }
    
        $.history.init(function(url) {
                load(url == "" ? "1" : url);
            });
    
        $('#bbon a').live('click', function(e) {
                var url = $(this).attr('href');
                URLDecoder.decode(location,"UTF-8");
                url = url.replace(/^.*#/, '');
                $.history.load(url);
    
                return false;
            });
    
        load(defaultnum); //just load it
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've searched around a bit, but haven't found a satisfactory answer, so I'd like
I've googled around and searched the MYSQL docs ad nauseam and couldn't find a
I've searched for this a little but I have not gotten a particularly straight
I've searched and searched but nothing has really worked. I'm trying to set a
I am developing an extension to add graphics around code (text). I've searched around
I've searched for a while but i can't either find an answer or come
I've searched around a bit in the small amount of iPhone/iPod Touch development information
I've searched on the Internet for comparisons between F# and Haskell but haven't found
I've searched a lot for an answer for this question in the web: they
I've searched the web a bit, but all I found were abandoned projects and

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.