Jquery – Microsoft JScript runtime error: ‘$’ is undefined on the Jquery function


i have the following Jquery function inside my view:-

    <script type="text/javascript">
        $(document).ready(function () {
            $("#album-list").mouseover(function () {
                $(this).animate({ height: '+=15', width: '+=15' })
.animate({ height: '-=15', width: '-=15' });

i have added the following scripts to the _layout view:-

<script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.14.min.js")" type="text/javascript"></script>

but when i navigate to the view that contains the above Jquery function; the following error will be raised ""Microsoft JScript runtime error: '$'"". So what might be the problem?

Best Solution

Are you loading your scripts after your inline script? The inline script must be placed after jquery is loaded.

If that is the case, please check the location of your jquery scripts.