javascript中 (function()....)isclassicjQuery,isequalto (document).ready(function() {….}). That means this function will be executed after the html is loaded. This way is safer to deal with DOM after page is loaded.
(document).ready(function())== (function(){});