Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing jQuery in ASP.NET MVC Content PlaceHolder
    text
    copied!<p>I have included jQuery as well as colorize plugin reference in my master page and I want to use it in my Content pages. My scripts are located in Scripts folder in MVCApplication. I am referencing it in my master pages as :</p> <p><code>&lt;script language="javascript" type="text/javascript" src="&lt;%= Url.Content ("~/Scripts/jquery-1.3.2.min.js")%&gt; " /&gt;</code></p> <p>and same for colorize.js.</p> <p>In my Content page, I am using colorize plugin for my table. </p> <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt; &lt;script language="javascript" type="text/javascript"&gt; $(document).ready(function() { $('#mytable').colorize(); // put all your jQuery goodness in here. }); &lt;/script&gt; &lt;table id="mytable"&gt; ... ... &lt;/table&gt; &lt;/asp:Content&gt; </code></pre> <p><strong>But whenever I run this application, neither jQuery works nor the colorize function work.</strong> </p> <p>Solutions I tried : </p> <ol> <li><p>Viewed the source in IE 7 and jQuery.js &amp; colorize.js are references properly.</p></li> <li><p>Viewed the source in FF 3.5.6 and Google Chrome, and I saw that jquery.js is referenced properly but colorize.js reference is not at all included in HTML.</p></li> <li><p>Later in FF, I jQuerified my mvc app, and all worked properly(references as well as colorize fn ).</p></li> </ol> <p>So I want to know where I am doing wrong, in referencing script files in master pages or using colorize plugin in Content page?</p> <p>Also other suggestions are welcome.</p>
 

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