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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:28:02+00:00 2026-05-15T03:28:02+00:00

I have this jQuery ajax navigation tabs plugin that I created using some help

  • 0

I have this jQuery ajax navigation tabs plugin that I created using some help from CSS-Tricks.com and the jQuery hashchange event plugin (detects hash changes in browsers that don’t support it).

The code is little long to post it here but it goes something like this:

Part 1) When a tab is clicked, it gets the href attribute of that tab and add it to the browsers navigation bar like ‘#tab_name’: window.location.hash = $(this).attr("href");

Part 2) When the navigation bar changes (hash change), it gets the href change like this: window.location.hash.substring(1); (substring is to get only ‘tab_name’ without the ‘#’), and then call the ajax function to get the info to display.

I want to automatically trigger the plugin to load the first tab when the page is accessed, so at the start of the code I put:

if (window.location.hash === '') { // If no '#' is in the browser navigation bar
   window.location.hash = '#tab_1'; // Add #tab_1 to the navigation bar
   $(window).trigger('hashchange'); // Trigger a hashchange so 'Part 2' of the plugin calls the ajax function using the '#tab_1' added
}

The probles is that it works in FF but not in Chrome, I mean, everything works but it seems like the $(window).trigger('hashchange'); is not working because it doesnt get the first tab..

Any suggestions??

Note: It worked some time ago but suddenly it doesn’t (maybe Chrome update).

  • 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-15T03:28:03+00:00Added an answer on May 15, 2026 at 3:28 am

    I suspect that you’re attempting to trigger the event in a way the browser is not happy with. Where is your handler for “hashchange” defined? I suggest you try binding it to

    $('body').bind('hashchange', function() { ... })
    

    instead of “window”. Even that might give you problems in WebKit browsers; if so, you can create a <div> to wrap your body content, and bind to that.

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

Sidebar

Ask A Question

Stats

  • Questions 429k
  • Answers 429k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer insert into foo DEFAULT VALUES May 15, 2026 at 1:46 pm
  • Editorial Team
    Editorial Team added an answer foreach (array_keys($arr) as $k) { if (preg_match('/^field_id_(\\d+)_directory$/', $k, $matches)) {… May 15, 2026 at 1:46 pm
  • Editorial Team
    Editorial Team added an answer You must be using Silverlight 4. Try downgrading to 3.… May 15, 2026 at 1:46 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.