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

The Archive Base Latest Questions

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

I followed this thread . I now have: <a href=# onclick=$(‘#gc’).load(‘test’);>reload</a>… </span> <div id=gc>

  • 0

I followed this thread. I now have:

<a href="#" onclick="$('#gc').load('test');">reload</a>... </span>
<div id="gc">
    empty
</div>

This is what I am getting:

Uncaught exception: TypeError: Cannot convert '$('#gc')' to object
Error thrown at line 1, column 0 in <anonymous function>(event):
    $('#gc').load('test');

What is that? I thought I would be able to select a div and replace the contents with load()?

  • 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-18T23:55:27+00:00Added an answer on May 18, 2026 at 11:55 pm

    Try attaching the event handler on domready:

    HTML:

    <a href="some-url" class="reload_link">reload</a>
    ...
    

    JS:

    (function($) {
      $(function() {
         $('.reload_link').click(function() {
            $(this).next('div').load(this.href);
            return false;
         });
      });
    })(jQuery);
    

    I like to wrap my jQuery code inside of an anonymous function using a $ argument to avoid name conflicts with other libraries. (Of course, I could just use jQuery.noConflict() as well)

    The way this works is it retrieves all elements in the document that have a class of reload_link, then for each one, it retrieves the next <div> element and invokes load, passing in the current <a> element’s href attribute.

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

Sidebar

Related Questions

I have followed this thread now when i try to build using maven plugin
I followed this thread: datepicker by clicking on textfield I imported both of the
I've followed THIS thread to remove the border that surrounds the Gallery, but the
Ok, sorry if this question is stupid. I followed this tutorial: http://www.youtube.com/watch?v=E30_-pQGQXs . Now
I followed the instructions in this thread to create a daily alarm that starts
I mainly followed this thread: How do you add files to a jar using
This question is related to this previous thread . I followed Tomas's suggestion using
I followed this thread to install Mono on my Fedora box: Install Mono on
So I followed this thread: RootViewController Switch Transition Animation to transit the window.rootViewController from
I followed this thread to connect to gmail to send email without user intervention:

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.