- Published on
jQuery - Safe 'onReady' code
- Authors

- Name
- Martin Andrews
- @mdda123
Just a quickie that combines the $(fn) method of calling a function when the DOM is ready, with an anonymous function that ensures that $ refers to jQuery :
(function($) {
$(function () {
// your code to fire when the DOM is ready
});
})(jQuery);