|
|
|
|
|
by projct
5166 days ago
|
|
You are making part of your page always load at least 2 seconds slower than is probably necessary. $(function(){}); is shortcut for $(document).ready(); which waits until all other external content has been loaded. [1] If for some reason you are loading something else you need after .ready() fires, and you can't load that inside of a single .ready() call for some reason, you can potentially add multiple callbacks to .ready() (they will be executed in order [2]), or attach a .load() to that particular item instead (maybe even inside your .ready().) Timeout hacks are not a performance improvement. [1] http://api.jquery.com/ready/
[2] http://stackoverflow.com/questions/5263385/jquery-multiple-d... |
|
http://stackoverflow.com/questions/4395780/difference-bw-onl...