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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:54:19+00:00 2026-05-28T02:54:19+00:00

Hy everyone i’ve been trying for 2 days to modify this script so i

  • 0

Hy everyone i’ve been trying for 2 days to modify this script so i can call it whenever a link had the id=”paginations” unsuccessful of course ( just because i’m a newb ).

What exactly i am trying to do is call this function to load and change the #content even if the link is inside the #content. Like this.

  <div class="pagination">
    <a href="test.php">clik2</a>
  </div> 

I’ve trying to create a function and call it with onClick but i was unsuccessful. This script works perfectly if the link is outside the #Content but i need it to work inside the #Content also. Any ideas please ?

$(document).ready(function() {

var hash = window.location.hash.substr(1);
var href = $('.pagination a').each(function(){
    var href = $(this).attr('href');
    if(hash==href.substr(0,href.length-5)){
        var toLoad = hash+'.html #content';
        $('#content').load(toLoad)
    }                                           
});

        $('.pagination a').click(function(){

            var toLoad = $(this).attr('href')+' #content';
            $('#content').hide('1000',loadContent);
            $('#load').remove();
            $('#wrapper').append('<span id="load"></span>');
            $('#load').fadeIn('slow');
            window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
                function loadContent() {
                    $('#content').load(toLoad,'',showNewContent())
                }
                function showNewContent() {
                    $('#content').delay(100).show('fast',hideLoader());
                    $(window).scrollTop('');
                }
                function hideLoader() {
                    $('#load').delay(300).fadeOut('fast');
                }
            return false;
    });
});
  • 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-28T02:54:20+00:00Added an answer on May 28, 2026 at 2:54 am

    If the link is being added with javascript, which I think is what you are trying to do then you need to use the live function. Currently you have

    $('.pagination a').click(
    

    Which should be replaced with:

    $('.pagination a').live('click',function() {
    

    You can read more about live here. The problem with click is that it does not get added to elements that are created after the function has been set, where as live will.

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

Sidebar

Related Questions

everyone! I've been at this for a while, and I'm not sure how this
everyone. I am trying to create a database in which I can store pictures
everyone, i have no idea why this doesn't work hopefully someone here can help
Everyone has this huge massively parallelized supercomputer on their desktop in the form of
Everyone is familiar with this functionality. If you open up the the outlook address
Everyone uses source-code control to manage versions (right?) and this provides some level of
everyone. I know this is a far treated subject, but I've looked everywhere and
everyone. I am an experienced C programmer trying to get adjusted to C++. I
Everyone likes to talk about reusability. Where I work, whenever some new idea is
everyone..i want after i type 0203-ED in textfield ...two character behind that text can

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.