Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript best practices for asp.net mvc developers
    primarykey
    data
    text
    <p>Apologies for the question being so subjective.</p> <p>I'm looking for some practical examples of how to manage javascript better in asp.net mvc applications.</p> <p>Prior to jQuery I tried to avoid using javascript as much as possible. Now I'm using it a lot but feel I may have missed some best practices / recommendations for structuring my javascript code in larger web applications.</p> <p>Some things that I am guilty of and want to move away from:</p> <ol> <li>Inline javascript in my views. I'm not talking masses of code but it's not uncommon for me to have some initialization code on each view.</li> <li>One large "site" javascript file. As the list of plugins used in my application grows (for example jquery ui), so too does my "startup" function which is initializing each plugin. Often this is to avoid issue 1 (adding javascript inline). Perhaps a javascript file per view is a better solution?</li> <li>Everything seems very procedural. I'm used to working in an object oriented way in .net, but when it comes to javascript this seems to go out the window. Now I know OOP is certainly possible, and encouraged with javascript but I could do with seeing some practical examples of how I should be doing it in the context of a real web application.</li> <li>Namespacing / project structure - I've seen a few examples of javascript namespacing (by virtue of objects) and like the approach but again could do with some more background knowledge.</li> </ol> <p>Any sites, books etc. that people can recommend would be appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload