¡@

Home 

2014/10/16 ¤W¤È 12:03:10

jquery Programming Glossary: encapsulation

Why define anonymous function and pass it jQuery as the argument?

http://stackoverflow.com/questions/10371539/why-define-anonymous-function-and-pass-it-jquery-as-the-argument

2010 3 JavaScript Module Pattern In Depth The purpose of this code is to provide modularity privacy and encapsulation for your code. The implementation of this is a function that is immediately invoked by the calling jQuery parenthesis. The.. a DOMReady function. I among many others prefer to do this inside of a JavaScript Module pattern so that I can provide encapsulation and privacy for my code. I tend to use the Revealing Module pattern see the first link above to provide access to the bits..

JQuery JavaScript Design: Self Executing Function or Object Literal?

http://stackoverflow.com/questions/188663/jquery-javascript-design-self-executing-function-or-object-literal

I construct a page I like to encapsulate the functions used within that page inside an object. This allows me some encapsulation when building applications. There's nothing I hate more than seeing a JavaScript file with a bunch of this function doSomethingOnlyRelevantOnThisPage.. really encapsulate functionality nicely. Commonly in many frameworks there is a standard that is used to perform this encapsulation. In Mootools they favor the Object Literal Notation var Site properties and methods In YUI they favor the Self Executing..

What is meant by ?œleaking??into global scope?

http://stackoverflow.com/questions/5951228/what-is-meant-by-leaking-into-global-scope

persistent custom objects why is the Module Pattern below bad Design patterns let you encapsulate complex logic is encapsulation suddenly bad simply because we ™re writing in JavaScript Or...is this commenter simply wrong Here is the Module Pattern I.. your module globally. The issue is having global namespaces. Design patterns let you encapsulate complex logic is encapsulation suddenly bad simply because we ™re writing in JavaScript Now that I've cleared up the intent of the comment this question..