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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:12:19+00:00 2026-06-08T06:12:19+00:00

In my website, I build the page navigation based on hashchange : var hashHome;

  • 0

In my website, I build the page navigation based on hashchange:

var hashHome;
$(window).bind( 'hashchange', function(e) {
    var homeClass = "home";
    var url = $.param.fragment();
    if($('#page-content').hasClass(homeClass)){
        hashHome = $('#page-content').html();
    }

    if(url ==''){
        //homepage with nothing(no hash)
        if(!$('#page-content').hasClass(homeClass)){
            //alert("load frim cache ->#"+url);
            $('#page-content').addClass(homeClass);

            $('#page-content').html(hashHome);
        }
    }else{
        //go to some page 
        if($('#page-content').hasClass(homeClass))
            $('#page-content').removeClass(homeClass);
        initAction(url);
    }
})
$(window).trigger( 'hashchange' );

When the site loads its homepage, the homepage gets stored in hashHome. If user navigates away, the initAction(id) replaces the entire $('#page-content')‘s content with other pages’ content. When the uses navigates back to home, it restores the stored home back to the $('#page-content').

My problem is that all of the jQuery stopped working on the homepage.

I’ve read about live() already but it seems that it needs a event like click() for it to work. How do I fix this?

  • 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-08T06:12:22+00:00Added an answer on June 8, 2026 at 6:12 am

    I figured out that i need to store my entire page before i change the content of the div that is surrounding it

    var content$('#page-content').html();
    

    then do the content change

    that way, when i reinitialize all my jQuery plugins, they will loose all of their old reference and use the new content variable, instead of a double initialization

    and finally, i’ve the original question’s code also won’t work since the script tag look like this: <script type="text/javascript">...</script>, IE for some reasons won’t recognize this, so I have to change it to <script></script> in order to make it cross browser compatible

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

Sidebar

Related Questions

I am looking to build a home page for a website. I would like
I want to build a website similar with tumblr homepage. On that page, while
I'm creating an e-commerce website and I wanted to build a page where I
all. I am required to build a website with each page under 130kb. I
I'm about to build a search page on a website and the search is
I'm trying to build a page on my personal website that both used jQuery
i have an asp.net mvc website where i build up most of the page
The website is build with Codeigniter MVC framework. I have a page that is
I am attempting to build a gallery page for a website I am working
I built a blackberry app with Phonegap. Phonegap build website built my app 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.