Search code examples
javascriptjqueryasp.net-mvcproject-structure

structure for jquery in my mvc project


whats the best way of structure jqueryfiles in my mvc app. Now i have all my scripts in script folder and it starting to be difficult to have a good overview.

//thanks


Solution

  • We used the following structure on my last project:

    Scripts
    |
    |- jQuery
    |- Libraries
    |- Infrastructure
    |- PageSpecific
    

    jQuery contained jQuery and any plugins. Libraries contained other third-party libraries (e.g. underscore.js). Infrastructure contained shared JavaScript modules, e.g. one full of utility functions, or one for handling server-side account-management communications, etc. PageSpecific contained code to wire up event handlers and page-specific logic.