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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:47:39+00:00 2026-05-23T12:47:39+00:00

What happens if I do not pass the jQuery object invoking the anonymous function:

  • 0

What happens if I do not pass the jQuery object invoking the anonymous function:

$(function($) {...} 

instead of

$(function($) {...} (jQuery);

It still seems to work in all scripts so why pass it explicitly as stated everywhere on the net?

  • 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-23T12:47:40+00:00Added an answer on May 23, 2026 at 12:47 pm

    What if you have another library that uses $ as its main object? In that case, it is possible that the second library’s object be passed to your function and your plugin break.

    Imagine that you use a library of mine called foo. In that library I use # as my global object. To use my library, you start your code with # as:

    #.getAllLinks().follow();
    

    Now imagine that you use still another library which like jQuery uses $ sign as its root object. (I think Google Analytics is such a library). In that case, the latest library to load in the browser, wins the race and takes the $ sign under control. In this case, when you want to use $ in your plugin, you’re actually referring to a wrong library. But when explicitly passing jQuery name (jQuery’s root object is both accessible using $ sign or jQuery), then you can get sure that in the scope of your plugin, you use jQuery, not another library. 🙂

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

Sidebar

Related Questions

What happens in the memory when a class instantiates the following object? public class
I'm using the jQuery Plugin jqModal . New to it, so i'm still learning
The title pretty much says it all. I'm trying to use jQuery's ability (hoping
this is actually my first ZK project seems pretty cool but not working and
and can it be configured not to happen? I'm usually finding myself saving a
What happens if I use SHGetFolderPath api call in a 32 bit system with
What happens to exceptions raised while in myMethod: if it is invoked via NSObject's
What happens to the name/value pairs stored inside a form's resx file? Are they
What happens when the Office 2003 PIA prerequisite and launch condition in a Windows
This happens repeatedly and is very annoying. I upload some PHP code to a

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.