Considerations with Writing JavaScript in your DotNetNuke site
by Engage Software
- 2,927 views
Whether you want to take advantage of jQuery, ASP.NET AJAX, or just plain JavaScript, come learn the rules and guidelines for taking advantage of JavaScript within your DotNetNuke site. We'll talk ...
Whether you want to take advantage of jQuery, ASP.NET AJAX, or just plain JavaScript, come learn the rules and guidelines for taking advantage of JavaScript within your DotNetNuke site. We'll talk through considerations for enhancing your content, skins, and modules, the best ways to include JavaScript behaviors, and some ways to avoid inconsistencies and frustration.
Statistics
- Likes
- 1
- Downloads
- 16
- Comments
- 2
- Embed Views
- Views on SlideShare
- 2,926
- Total Views
- 2,927


Effectively, the module pattern has all of your script happening inside of a call to an anonymous function. Because you're in a function, all of the variables and functions created are scoped to that function, and not accessible from outside of that function (i.e. not accessible from any other script on the page). This keeps your script non-intrusive and maintainable. You can have your module return something if you need to make part of its functionality available outside of the module itself. You can also pass in arguments to the function (e.g. jQuery) in order to have a local reference to them. You can also look at the 'plugin development pattern' link that is on slide 10, in that article's 'Keep private functions private' section for another example.
Hope that helps! 2 years ago