managing document.ready event(s) on a large-scale website

后端 未结 9 1435
予麋鹿
予麋鹿 2021-01-30 10:51

NOTE: I have now created a jQuery plugin which is my attempt of a solution to this issue. I am sure that it could be improved and i\'ve probably overlooked lots of use c

9条回答
  •  北海茫月
    2021-01-30 11:49

    I know where you're coming from. Right webapps for mobile use it can feel silly making the user download a massive JS file full of irrelevant code (the JQuery API for one is a bad start!).

    What I do, which may be right or wrong but certainly seems to work is include required functions on a page by page basis before the tag. (This position for the most part, gets around the document.ready issue). Yet can't help but feel this approach is too simple.

    I am interested in hearing other answers though so it's a good question, +1.

提交回复
热议问题