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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:51:54+00:00 2026-06-01T06:51:54+00:00

Having a persistent problem with Jquery in firebug…frequently I’ll type some JQuery statement into

  • 0

Having a persistent problem with Jquery in firebug…frequently I’ll type some
JQuery statement into the firebug console and it won’t work, I’ll try to load a
JQuery Object into a variable and will just get an ‘undefined’ error.

I found a code snippet somewhere in a Stack Overflow comment that makes everything work, its something like

($){
    //all of your JQuery goes here
}(JQuery);

…
Something like that. This piece of code definitely makes all my JQuery go, I just can’t understand why. Possibly it has something to do with namespaces or something? I have been cutting and pasting it from bookmark to scripts for a while, kind of would rather have insight. I see some sample scripts in Stack Overflow that include this code, and some that don’t. I have the Apress JQuery and the Firebug books, neither one mentions it. I have the JQuerify plugin to firebug, and mostly work on Drupal sites which include JQuery by default. Still need this code to make things work.

So My question is — what is the purpose of this code, what is it called (so I have a search term aside from just browsing this site hoping for code that includes it) and is there any reason to think that its necessary to make a JQuery script work in the firebug console? If there’s not, is there some deeper issue that this code addresses, and are there other ways to address it?

Thanks a lot,

  • 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-01T06:51:56+00:00Added an answer on June 1, 2026 at 6:51 am

    Whenever you want to use jQuery on the Firebug console, you need to make sure that jQuery is actually loaded. If you’re on a page that uses jQuery, you’re good to go. Otherwise the library first needs to be included (<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>).

    If the $ shortcut is used by another library, you’re still able to use the global “jQuery” named variable. To restore the $, you can put your code in a closure:

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

    But don’t confuse this syntax with the shortcut for jQuery’s ready event (I’m not really sure what you’re referring to with that code snippet):

    $(function() {
        // ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a problem of setting the data of a (persistent/cross browser session)
I'm having some problem persisting object with my GWT-App engine project which I use
I'm having some problems in persisting the viewstate on postback for a Control (vb.net)
Having a bit of a problem, Due to the source-control set-up we use, each
Having some issues getting my head around the differences between UTF-8, UTF-16, ASCII and
I'm stuck on a problem for hours now and having read everything about this
I'm trying to add functionality to the v8sharp project and I'm having some issues
I'm having a problem with the sessions in my python/wsgi web app. There is
I come from a C/C++ background and am having trouble doing some things in
I have a big problem, and I am having a hard time solving it.

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.