Part II – Setting up JQuery
For Part I Please click following link
Considering you have are already downloaded JQuery files (see note below) from JQuery website or you have Microsoft or Google CDN (Content Distribution Networks) link (more on this below in this post). The first thing you need to do for using JQuery is setting up JQuery reference in the Html document / Razor view (MVC – we are not discussing about _layout.cshtml).
- To reference JQuery in html document – you the script tag in the Header of the Html document .
<head> <title>Example</title> http://jquery-1.7.js <link rel=”stylesheet” type=”text/css” href=”styles.css”/> </head>
- Using CDN link to reference JQuery in HTMl documents ( see notes for CDN pros and cons).
<head> <title>Example</title> http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js <link rel=”stylesheet” type=”text/css” href=”styles.css”/> </head>
- More on CDN pro and cons .. later..