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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:24:18+00:00 2026-06-15T18:24:18+00:00

I am having a little problem using javascript-ajax here. In my page, I load

  • 0

I am having a little problem using javascript-ajax here. In my page, I load in the content into one of the div with id content in an ajax manner, whenever the user clicks on links which have the class myajaxreq, and the contents are loaded into the div in a fade in manner. The javascript that I am using is this

$(document).ready(function(){
    $("#content").load($('.myajaxreq:first').attr('href'));
});


$('.myajaxreq').click(function() {
    var myhref=$(this).attr('href');
    $('#content').hide().load(myhref).fadeIn('slow');

    return false;
}); 

All works great on localhost, but when i put it online and then when we click on these links, then: First the same content which was initially there in the div is loaded in fade in manner. After a few seconds, the new content is loaded.

I think I am missing some sort of

if(content document is ready)
     then load in a fade in manner
         and so on..

Please somebody help me out here !!

  • 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-15T18:24:19+00:00Added an answer on June 15, 2026 at 6:24 pm

    call fade in after success callback… try this

    var jContent = $('#content').hide();
    jContent.load(
            myhref,
            {},
            function(){
                jContent.fadeIn('slow');
            }
        );
    

    here the whole code (untested)

    $(document).ready(function(){
        var jContent = $("#content").load($('.myajaxreq:first').attr('href'));
    
        $('.myajaxreq').click(function() {
            var myhref=$(this).attr('href');
            jContent
              .hide()
              .load(
                myhref,
                {},
                function(){
                    jContent.fadeIn('slow');
                }
            );
    
            return false;
        }); 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a little problem here. I have a <script language =JavaScript runat=server>
I'm having a little problem with using conditionally evaluated expression in jsf/a4j Here's my
I'm having a little problem here, I'm new to Actionscript 3, and what I'm
i have little problem in using my application application having msaccess database if i
I'm having a little problem changing members of an object in a list using
I'm having a little problem with vim. I'm using Debian testing and --version gives
I am having a little problem here. Error1 'System.IO.MemoryStream' does not contain a definition
I'm having a little problem using Navigation properties and inheritance on ADO.NET. This is
I'm having a little problem. I'm trying to use Jquery load() function to load
I'm having a little problem using NSURLDownload . Basically I'm downloading two different files

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.