Componetizing jQuery functions calls. Best practices?
问题 I'm building a site that is going to consist of components. A component defined as a particular set of HTML and CSS and jQuery. Each page of the site will consist of many components. Per best practices, we're putting our javascript block at the bottom of the page. We load the needed .js files, and then I'm planning on calling the functions needed: doThisThing(); doThatThing(); Let's say I have Component X. I want to call a function whenever that component appears on the rendered page. From a