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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:34:46+00:00 2026-06-07T15:34:46+00:00

This code works fine in Firefox and IE. In Chrome, you need to click

  • 0

This code works fine in Firefox and IE. In Chrome, you need to click each link twice and even then the page loads twice. There is an example at http://www.crowdfundcenter.com/ajaxpage.php and this is the code:

<script type="text/javascript">

$(document).ready(function () { <!-- Begin document ready function -->

    $.history.init(pageload);   

    $('a[href=' + window.location.hash + ']').addClass('selected');

    $('a[rel=ajax]').click(function () {    <!-- Begin click function -->

        var hash = this.href;
        hash = hash.replace(/^.*#/, '');
        $.history.load(hash);   

        $('a[rel=ajax]').removeClass('selected');
        $(this).addClass('selected');

        return false;

    }); <!-- End click function -->


}); <!-- End document ready function -->


function pageload(hash) {   <!-- Begin pageload hash -->
    if (hash) getPage();    
    }   <!-- End pageload hash -->


function getPage() {    <!-- Begin getPage function -->
    var loading = $("#loading");
    var data1 = document.location.hash;
    showLoading();
    switch(data1){
        case "#home":
            $('#content').slideUp();
            $('#content').load('xhome.html', hideLoading);
            $('#content').slideDown();
            break;
        case "#business":
            $('#content').slideUp();
            $('#content').load('xbusiness.html', hideLoading);
            $('#content').slideDown();
            break;
        case "#aboutus":
            $('#content').slideUp();
            $('#content').load('xaboutus.html', hideLoading);
            $('#content').slideDown();
            break;
        case "#hidpage":
            $('#content').slideUp();
            $('#content').load('xhidpage.html', hideLoading);
            $('#content').slideDown();
            break;
        default:
            $('.loading').hide();
            break;
    }

function showLoading(){
    loading
        .css({visibility:"visible"})
        .css({opacity:"1"})
        .css({display:"block"});  
        }

function hideLoading(){
    loading.fadeTo(1000, 0);
    };

};      <!-- End getPage function -->

</script>


<div id="wrapper">  <!-- Begin wrapper -->

<div id="header">
    <ul id="menu">
        <li><a href="#home" rel="ajax">Home</a></li> 
        <li><a href="#business" rel="ajax">Business</a></li> 
        <li><a href="#aboutus" rel="ajax">About Us</a></li>
    </ul>
</div>

    <div style="clear: both;"></div>

    <div style="display: block; float: left; height: 24px;">
    <div id="loading">
    <img src="img/loading99small.gif" alt="Loading..." />
    </div>
    </div>


    <div style="clear: both;"></div>


    <div id="content">  <!-- Begin content -->
        <!-- Ajax Content -->

<div style="display: block; width: auto; margin: auto;">

<div style="display: block; width: auto; margin: 0px 0px 0px 0px; color: #CCCCCC; font-size: 12px;">
    <h2>Home Page</h2>
    This is the home page generated by code on this page.
</div>
    </div>


</div>  <!-- End content -->


<div style="display: block; float: left; clear: both;"></div>


<div style="display: block; width: auto; margin: auto;">  <!-- Begin footer -->

<div id="footer" style="display: block; margin: 40px 0px 40px 0px; color: #808080; font-size: 16px; font-weight: bold;">
    This is the footer for the page.
    </div>

    </div>  <!-- End footer -->

</div>  <!-- End wrapper -->

Everything works fine in Firefox and IE. The problem is Chrome and don’t know what the problem is, any assistance is greatly appreciated.

  • 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-07T15:34:48+00:00Added an answer on June 7, 2026 at 3:34 pm

    The problem is all yours.

    You are issuing page loads in both

    • $('a[rel=ajax]').click(), and
    • $.history.init().

    So, the code is actually working as intended.

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

Sidebar

Related Questions

This code works fine in Chrome. However, in Firefox, when it hits the GMxhr
This code works fine in IE8/7 and Firefox... But in Google Chrome i got
I have a Firefox 3.6.2 problem (3.5.x works just fine). This is the code:
web page : http://sideradesign.com/eco-art/gallery/ This code works fine in all brwosers except IE8 (haven't
Please i need help, this code below works fine on my localhost, php5.3+ but
The page works fine in Chrome, but I have this one minor error in
I made a login/register page. It works fine on chrome and firefox, but doesnt
This code works fine, but I'll want to handle exception if any thing goes
this code works fine until I start scrolling: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
This code works fine to find an available room within certain date, but it

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.