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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:44:22+00:00 2026-05-18T09:44:22+00:00

I have a page that has haschhange tabs so when I click on a

  • 0

I have a page that has haschhange tabs so when I click on a link the url looks like http://www.site.com/abc.php#123.php

but because of this my functions don’t work.

I have a page specific script that works if i go to http://www.site.com/123.php. But it won’t work when the page is loaded in via ajax by the hashchange plugin.

I was thinking that I needed to use the .live() so that when the page loads it would capture the new content… hmmmm

is there another way of doing this?

I’m trying to run this code on my 123.php page:

$(“.tab_content”).hide(); //Hide all content
$(“#files_left_pane > ul.tabs li:first”).addClass(“active”).show(); //Activate first tab
$(“#files_right_pane > .tab_content:first”).show(); //Show first tab content
//On Click Event
$(“#files_left_pane > ul.tabs li”).click(function() {
$(“#files_left_pane > ul.tabs li”).removeClass(“active”); //Remove any “active” class
$(this).addClass(“active”); //Add “active” class to selected tab
$(“#files_right_pane > .tab_content”).hide(); //Hide all tab content

var activeTab = $(this).find(“a”).attr(“href”); //Find the href attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active ID content
return false;
});

UPDATE:

I have tried to wrap my script in $(selector).live(‘click’, function(){}); but what I’m noticing is that any JS i place in the 123.php won’t be excecuted once loaded via hashchange

UPDATE: Nevermind, I had to run the function in the code that initiated the haschange and loaded in content via ajax.

Thanks prodigitalson

  • 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-18T09:44:23+00:00Added an answer on May 18, 2026 at 9:44 am

    I would j define the code youve provided as a function and then use that function as art of your success callback for the ajax:

    function updateTabs(){
      // the code you provided
    }
    
    // exmaple ajax call:
    
    $.get(theUrl, function(){
      // other logic you need
    
      updateTabs();
    });
    

    This allows you to reuse your code after/bfore any number of operations. I dont think live is really the issue hear because you want to run this after youve appended new content to the DOM but that content isnt unique to a single specific element being added from what i can tell.

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

Sidebar

Related Questions

I have a page that has multiple sliders (from http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div ) and since each
I have a page that has 3 variables. They look like this: String[] Headers
I have a page that has a Contact Form slide down when a link
I have a page that has two tabs created using jQuery, and I am
I have a page that has multiple selectors. Each has an on click event.
I have a page that has a few links that I would like to
I have a page that has no vertical scroll, rather, everything is displayed horizontally.
I have a page that has a gif animation in a hidden div. Upon
I have a page that has fields dynamically loaded via JQuery. It allows a
I have a page that has 2 columns of words, 20 total, that are

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.