Why is the jQuery object constructed as a local copy inside a Module pattern inside a self-executing function?
-
This is true for at least for 1.4 and 1.5. Paul Irish explains how it works here: but he doesnt explain why. What are the benefits of this pretty complicated object construction? What options are there?
-
Answer:
Originally, jQuery was defined as a traditional function expression that returned an instance of the jQuery.fn.init() constructor. As the library and it's requirements grew and code base demanded further compartmentalization and privatization of logic the Module Pattern function expression was added to wrap up this logic and allow a clean return of the jQuery() function.
Rick Waldron at Quora Visit the source
Related Q & A:
- Can a US Citixen, and a licensed RN take a controlled substance to an RN travel assignment to Scotland?Best solution by Yahoo! Answers
- Can I record a program/movie from a cable dvr to a DVD recorder?Best solution by Yahoo! Answers
- Is it better to get a higher grade in a easier class or a mediocre/low grade in a hard class?Best solution by greatcollegeadvice.com
- How to connect a psp go to a PS3 controller using a computer?Best solution by eHow old
- How do you put a picture inside a picture frame of a picture using photoshop?Best solution by youtube.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.