jQuery best practices in case of $('document').ready

前端 未结 9 1291
孤街浪徒
孤街浪徒 2020-12-07 11:35

I was researching on jQuery best practices and found this article by Greg Franko

Normally, I do:

$(\"document\").ready(function() {
    // The DOM i         


        
9条回答
  •  时光取名叫无心
    2020-12-07 12:12

    You can use document ready event using jquery, event occure when document is fully loaded.

     $(function () {
        setTimeout(function () {
            // your code
        }, 0);
    })
    

提交回复
热议问题