{"id":736,"date":"2012-06-03T14:54:46","date_gmt":"2012-06-03T14:54:46","guid":{"rendered":"https:\/\/theextremewebdesigns.com\/blog\/?p=736"},"modified":"2012-06-03T14:54:46","modified_gmt":"2012-06-03T14:54:46","slug":"jquery-document-ready-with-shortcuts-shorthand-notation","status":"publish","type":"post","link":"https:\/\/theextremewebdesigns.com\/blog\/jquery-document-ready-with-shortcuts-shorthand-notation\/","title":{"rendered":"jQuery Document Ready with Shortcuts \/ Shorthand notation"},"content":{"rendered":"<p>Did you ever want to trigger an action automatically upon page load? You can now do it using document ready function. In this article, I will be discussing different ways of using\u00a0<strong>jQuery document ready\u00a0with Shortcuts \/ Shorthand notation<\/strong>.<!--more--><\/p>\n<h2>jQuery Document Ready with Shortcuts \/ Shorthand notation<\/h2>\n<p><strong>jQuery Document Ready Function<\/strong><\/p>\n<pre class=\"lang:js decode:true\">$(document).ready(function() {\n\/\/ Your code here\nalert('Page loaded');\n});<\/pre>\n<p><strong>jQuery <strong>Document\u00a0<\/strong>Ready Function Shortcut<\/strong><\/p>\n<pre class=\"lang:js decode:true\">$(function() {\n\/\/ Your code here\nalert('Page loaded');\n});<\/pre>\n<p><strong>jQuery Document\u00a0Ready Function &#8211;\u00a0noConflict version<\/strong><\/p>\n<pre class=\"lang:js decode:true\">jQuery.noConflict();\n(function($) {\n$(function() {\n\/\/ Your code here\nalert('Page loaded');\n});\n})(jQuery);<\/pre>\n<p>The\u00a0noConflict version is very useful when you are working with multiple javascript frameworks on the same page and do not want the frameworks to clash with each other.<\/p>\n<p><strong>Simple, isn&#8217;t it?<\/strong><\/p>\n<p>Do you know of any other ways to declare\u00a0<strong>jQuery $(document).ready()<\/strong>? Feel free to suggest by commenting below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Did you ever want to trigger an action automatically upon page load? You can now do it using document ready function. In this article, I will be discussing different ways of using\u00a0jQuery document ready\u00a0with Shortcuts \/ Shorthand notation.<\/p>\n","protected":false},"author":1,"featured_media":395,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20,13],"tags":[41],"class_list":["post-736","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery-tips-and-tricks","category-tips-and-tricks","tag-jquery-tips"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paBnQX-bS","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/comments?post=736"}],"version-history":[{"count":0,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/736\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/media?parent=736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/categories?post=736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/tags?post=736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}