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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:24:55+00:00 2026-05-18T04:24:55+00:00

I have a really basic question about jquery. However I don’t know how to

  • 0

I have a really basic question about jquery. However I don’t know how to this so that’s why i’m here looking for your help. This is my code:

Edit: <a href="javascript:$('#target').load('page.html').fadeIn('1000');">Link</a>

As you see i want to load page.html into a div called #target. What I also want to do wich doesen’t work is to make page.html fade in when it loads. What’s the right way to that?

Best Regards

  • 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-18T04:24:55+00:00Added an answer on May 18, 2026 at 4:24 am

    First, you should put your Javascript code outside the element itself. This is fairly simple to do. It makes your HTML and Javascript much more easily comprehensible and ultimately allows much more organised code. First, give your a element an id:

    <a href='#' id='loadPage'>Link</a>
    

    Then make your call in a script tag:

    <script type="text/javascript">
        $(document).ready(function() { // when the whole DOM has loaded
            $('#loadPage').click(function(){ // bind a handler to clicks on #loadPage
                $('#target')
                    .hide() // make sure #target starts hidden
                    .load('page.html', function() {
                        $(this).fadeIn(1000); // when page.html has loaded, fade #target in
                    });
            });
        });
    </script>
    

    Edit To comment, yes you can use a URL in the a tag and then use this.href.

    <a href='page.html' id='loadPage'>Link</a>
    <script type="text/javascript">
        $(document).ready(function() {
            $('#loadPage').click(function(e){
                e.preventDefault();
                $('#target')
                    .hide()
                    .load(this.href, function() {
                        $(this).fadeIn(1000);
                    });
            });
        });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just learned Java in my college. However, in that I can just
I know this question may sound silly, but I am learning (at least trying)
There was a question asked about how to sort a List. There were several
I always coded console applications and learned some basic UML/patterns skills, using C++. Now
I am a new to developing for Android and have been reading up and
I've mastered the basics of Bash compound conditionals and have read a few different
A couple of weeks ago i have started my research in Iphone app development
As a programmer my first instinct is to start coding, but then again chapter
I am working on a web-site where I use the slimbox2 plug-in (similar to
Hey Im working on a folder tree and need to be able to limit

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.