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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:02:07+00:00 2026-06-09T11:02:07+00:00

What is the difference between var createControl = function (attribute){ …} and $.fn.createControl =

  • 0

What is the difference between

var createControl = function (attribute){ ...} 

and

$.fn.createControl = function (attribute) { .. }

in jQuery. What is the advantage of changing a function from $.fn.createControl to var createControl.

  • 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-09T11:02:09+00:00Added an answer on June 9, 2026 at 11:02 am
    var foo = function (param) { ... }
    

    Assigns a function to foo.

    $.fn.foo = function (param) { ... } 
    

    Extends the prototype of jQuery with foo. fn is just a shortcut to prototype and $ is a shortcut for jQuery. You could write the same thing as:

    jQuery.prototype.foo = function (param) { ... }
    

    The difference is that the former is just a variable within a certain scope, invisible outside of it. The later is a method extending the jQuery global object, thus making the variable accessible from anywhere since the jQuery object is attached to window, is global.

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

Sidebar

Related Questions

What's the difference between var myView = function () { //something goes here };
Is there any difference between these two LINQ statements: var query = from a
Is there any difference between doing this: $(.topHorzNavLink).click(function() { var theHoverContainer = $(#hoverContainer); var
What is the difference between the following 2 examples of code: (function(){ var myFunc
Can someone tell me the difference between: $(document).ready(function() { }); and: var someVar =
Is there any difference between function MyFunc() { // code... } and var MyFunc
What is the difference between this: var doSomething=function() { //do blah blah blah... }
In javascript, what is the difference between: var singleton = function(){ ... } and
Is there a difference between this: var onClick = function() { var image =
What is difference between these two statements: var result = from c in context.CustomerEntities

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.