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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:47:31+00:00 2026-06-13T03:47:31+00:00

Are these three equivalent? $(function(){ $(#a).html(i am a) }); (function($){ $(#b).html(i am b) })($);

  • 0

Are these three equivalent?

$(function(){
  $("#a").html("i am a")
});

(function($){
  $("#b").html("i am b")
})($);

(function(){
  $("#c").html("i am c")
})(); 

The code is available here.

Reference:

  • jQuery document ready functions
  • 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-13T03:47:32+00:00Added an answer on June 13, 2026 at 3:47 am

    The first one actually waits for the ready event, while the others do not.

    The second one is used for aliasing JQuery, but is useless in the way it is used now. You pass $, which is received in the parameter $. This construct is usually used when another library is used that assigns a different value to $. In that case you can call function($){...}(jQuery), to still have the $ variable pointing to jQuery in the scope of the function.

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

Sidebar

Related Questions

I have a reference of the dll file here: http://speex.org/docs/api/speex-api-reference/group__Codec.html What I'm wondering is,
I'm trying to follow the basic cometd example here: http://dojotoolkit.org/reference-guide/1.7/dojox/cometd.html It's using the old
The document.ready is used to execute code after the DOM is fully loaded. This
Can I trick the jquery text() function to accept html and not change the
I was under the impression that setInterval(/*some code*/, time) was equivalent to setInterval(function() {
Is there an equivalent function in Java for MidB$? The function returns the specified
Is there any equivalent function that returns the character at position X in PHP?
Is there any equivalent function of memset for vectors in C++ ? (Not clear()
Short version question : Is there navigator.mozIsLocallyAvailable equivalent function that works on all browsers,
Is there an equivalent Matlab dot function in numpy? The dot function in Matlab:

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.