mdda.net - personal website
ResearchTechTagsAbout
Home
Research
Tech
Tags
About
Published on
Friday, January 7, 2011

jQuery - Safe 'onReady' code

Authors
  • avatar
    Name
    Martin Andrews
    Twitter
    @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);

Tags

javascriptjquery

Previous Article

SciTE setup for Pylons (reminder)

Next Article

Pylons File Upload
← Back to the blog
mailgithubyoutubelinkedintwitter
Martin Andrews
•
© 2025
•
mdda
Tailwind Nextjs Theme