tags:

views:

62

answers:

3

I have content page , i am putting this inside it

<asp:Content ID="Content2" ContentPlaceHolderID="contentPanel1" runat="server">

      <script type ="text/javascript" src ="JScripts/jquery-1.2.6.js">
         </script>
</asp:Content>

The jquery is not loaded , none of the functions of jquery work.

i have also tried by putting it in masterpage ScriptManager like below , but still does not work.

<asp:ScriptManager ID="masterScriptManager" runat="server" 
        EnablePageMethods="True">
        <Scripts>
            <asp:ScriptReference Path ="~/JScripts/jquery-1.2.6.js" />
        </Scripts>

    </asp:ScriptManager>

Is there any way to assert whether jquery is loaded or not. Any ideas ?

A: 

You need to include jquery.js in the head section of your html page. So you could just add a placeholder in your master:

<head>
    <title>test</title>
    <asp:ContentPlaceHolder ID="Scripts" runat="server" />
</head>
...

and in your content page:

<asp:Content ID="indexScripts" ContentPlaceHolderID="Scripts" runat="server">
    <script type="text/javascript" src="JScripts/jquery-1.2.6.js"></script>
</asp:Content>
Darin Dimitrov
+2  A: 

Use Firebug to monitor what files are being requested by the browser. Look to see if jquery-1.2.6.js is actually being served or not. Check the file actually exists in the path the browser is requesting it from.

JonoW
A: 

To assert jquery is loaded at all you can paste javascript:alert($); into your location and hit enter. If you get undefined, jquery was not loaded. Also you may want to consider allowing google to serve jquery for you:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;

That way it is likely faster and you won't have to worry about folder paths on your server. Google also serves up other versions of jquery, and may have bug fixed versions for you.

Yuriy Faktorovich