On Jan 27, 2011, at 3:36 AM, Smith, Garren wrote: > Hi All, > > I want to know what is the best practice or how everyone organises there > javascript files. I initially use to just embed all my js in the html file > but that gets messy quick. Now I create an application.js file that I > reference on all pages. This is slightly better but often there is code only > specific to a page. Do you guys embed that in the html page?
You might want to take a look at requireJS: http://requirejs.org/ https://github.com/jrburke/requirejs Seems like it would be a great place to start if you want to avoid reinventing the wheel. > What about specific jQuery or your library uses for a particular page? Currently requireJS requires a special build of jQuery, so make sure you check out this page as well: http://requirejs.org/docs/jquery.html --Karl -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
