TheFilmGod Posted January 16, 2011 Share Posted January 16, 2011 What does this mean in jquery? $(function(){ Is the code executed after the dom is loaded or before? I don't want to be blindly coding and then have an error pop up in a few weeks because I'm using the wrong jquery code to begin the pages. Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/224592-what-does-function-in-jquery-actually-mean/ Share on other sites More sharing options...
trq Posted January 16, 2011 Share Posted January 16, 2011 That is a shortcut of.... ($document).ready(function() {}); Quote Link to comment https://forums.phpfreaks.com/topic/224592-what-does-function-in-jquery-actually-mean/#findComment-1160195 Share on other sites More sharing options...
requinix Posted January 16, 2011 Share Posted January 16, 2011 ...and if you check the documentation: The handler passed to .ready() is guaranteed to be executed after the DOM is ready, Quote Link to comment https://forums.phpfreaks.com/topic/224592-what-does-function-in-jquery-actually-mean/#findComment-1160197 Share on other sites More sharing options...
TheFilmGod Posted January 17, 2011 Author Share Posted January 17, 2011 I searched the jquery documentation high and low for what exactly "$(function(){" meant and couldn't find it. Thanks for the replies! Quote Link to comment https://forums.phpfreaks.com/topic/224592-what-does-function-in-jquery-actually-mean/#findComment-1160548 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.