0

I am using ajax controls. When I attach jquery.unobtrusive-ajax.min.js file only I am getting "Error: 'jQuery' is undefined". But when I attach jquery-1.4.4.min.js file too, everything is ok. Why?

1
  • Just don't forget to mark one of the answers that was most helpful to you. Commented Mar 22, 2012 at 6:42

3 Answers 3

2

Make sure you load it as follows:

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

It uses jQuery that is why it is needed. Plugins are built on top of jQuery and uses jQuery as the base. That is why it is needed on every page that has a jQuery plugin.

It's like building a house with no foundation. What will happen? The house will fall apart because there is nothing that it can stand on. The same scenario applies here.

Sign up to request clarification or add additional context in comments.

Comments

0

because it uses jQuery... so you must include jQuery!

Comments

0

you need to include the reference to jQuery library for other jQuery plugins to work. Without jQuery present in your page,you can not run any jQuery plugins.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.