Jquery – how to resolve Error: $ is not defined in jquery

asp.netasp.net-mvcjquery

i am using asp.net mvc in that i am using partial views but i get the following error

Error: $ is not defined
Line: 159

it is for the java script its not getting reference. i included the java script in site.master

     <script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"></script>
     <script src="../../Scripts/jquery-1.3.2.js" type="text/javascript"></script>
     <script src="../../Scripts/ui.core.js" type="text/javascript"></script>
     <script src="../../Scripts/ui.datepicker.js" type="text/javascript"></script>

first js is for partial view. and my function is:

<script type="text/javascript">
    $(document).ready(function() {
        var dt = { changeYear: true, yearRange: "-6:+6" }
        $("#FromDate").datepicker(dt);
    });
</script>

so can you tell me how to resolve reference problem.because of that date picker is also not working and partial views also not working but on local host it works fine but on server nothing is working.
i also used src="<%= Url.Content("~/Scripts/XXXX.js")%>" but still its not working on server.
thank you.

Best Answer

The problem will be with the path to the scripts I think. Where you have

src="../../Scripts/jquery-1.2.6.js"

you probably need to change this to something like

src="/Something/Scripts/jquery-1.2.6.js"

you could also try referencing an external version (as SO does).

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