Jquery – Shorthand for the ready event

A small tip this one but you can save a few characters by using shorthand for the $(document).ready function.

Instead of this…

$(document).ready(function (){
  // your <a title="See also PHP - Generating Unique ID's" href="http://www.whileifblog.com/2012/02/16/php-generating-unique-ids/">code</a>
});

You can do this…

$(function (){
   // your <a title="See also PHP - Split text up into 140 char array for Twitter" href="http://www.whileifblog.com/2011/09/10/php-split-text-up-into-140-char-array-for-twitter/">code</a>
});

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

More in Code, Javascript, Software, Tips (134 of 201 articles)


If you leave a URL in the comment form of a WordPress blog, it will be automatically transformed into a ...