Hmmm ...
To answer your first question: they should be placed in the <head> element.
Also, I usually use the 'bind' method when sinking events in the DOM (for example, it looks like you're trying to do).
So, the code will look like this:
$(document).ready(function() {
In addition, a few design tips (since you're working with something close to your heart (ASP.NET MVC with jQuery):
Add an additional "ContentPlaceHolder" at the bottom of the main <head> page. This will allow you to work with specific javascript on the page in the right place: in the "head" section of the page, and this will allow you to include page-specific javascript.
It will look something like this:
<asp:ContentPlaceHolder ID="HeadContent" runat="server" /> </head>
Why is this useful? . I will tell you: this rounded jQuery plugin that you use can only be used on a few pages - why include it on every page?
Dan esparza
source share