第一种: $(document).ready(function(){ alert("第一种方法。"); }); 第二种: $(function(){ alert("第二种方法。"); }); 第三种: jQuery(function($) { alert("第三种方法。"); });