jQuery document ready function

后端 未结 7 1205
南旧
南旧 2020-12-03 17:20

Are the end results of the following jQuery snippets identical?

Snippet 1:

$(function() { alert(\'test!\'); });

7条回答
  •  无人及你
    2020-12-03 18:08

    Yes, this is identical. but the first one is usually used in jquery for easiness.

    $(function() { 
        alert('test!'); 
    });
    

提交回复
热议问题