jQuery $(document).ready () fires twice

前端 未结 13 897
忘了有多久
忘了有多久 2020-11-29 03:13

I\'ve been sifting around the web trying to find out whats going on here and I have not been able to get a concrete answer.

I have one $(document).ready

13条回答
  •  孤独总比滥情好
    2020-11-29 03:41

    If the iframe doesnt show anything and is used for other reasons (like uploading a file without reload) you can do something like this :

    
    

    Notice that src is not included that prevents the second on ready trigger on the document.

提交回复
热议问题