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

前端 未结 9 1379
孤街浪徒
孤街浪徒 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:03

    In the rare situation when you'll have to work on an older jQuery version (if I recall correctly - pre 1.8.X), whenever you'd specify two document.ready blocks, only the first one would be fired in IE9.

    Now this is a rare bug I experienced once, or twice and which I fail to be able to reproduce, but I thought it would be worth noting.

提交回复
热议问题