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. 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() {}); 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, 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! 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
Archived
This topic is now archived and is closed to further replies.