Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I updated my aspx pages, but got 'jQuery' is undefined. The related code in the .aspx is below:
JavaScript
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/i18n/jquery-ui-i18n.min.js"
    type="text/javascript"></script>
<script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script src="../Scripts/jquery.ui.core.js" type="text/javascript"></script>
<script src="../Scripts/jquery.ui.widget.js" type="text/javascript"></script>

The errors like that:
'jQuery' is undefined jquery-ui.min.js, line 5 character1
Object expected jquery-ui.i18n.min.js, line 5 character1
What's wrong here? Thanks.
Posted
Comments
[no name] 5-Feb-14 9:00am    
If I use the old code like that
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"
type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/i18n/jquery-ui-i18n.min.js"
type="text/javascript"></script>
<script src='../Scripts/jquery-1.4.1-vsdoc.js' type='text/javascript'></script>
<script src='../Scripts/jquery.ui.core.js' type='text/javascript'></script>
<script src='../Scripts/jquery.ui.widget.js' type='text/javascript'></script>
<script src="../Scripts/jquery.ui.datepicker.js" type="text/javascript"></script>
No error displays. To update to new jquery version, what should I do here? Thanks.

As a prerequisite, jQuery UI requires jQuery library be loaded on the web page.
Add a reference to jQuery just before you call jQuery UI and the error will go away.
If you are using Google CDN, you can add the below line:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
 
Share this answer
 
v2
Comments
[no name] 5-Feb-14 9:18am    
I understand that it should should work if loaded from a local folder. Thanks.
There doesn't seem to be reference to jQuery itself.

Please add one such as this. You may want a newer version though.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>


[Please accept/up-vote answers or solutions that work for you to encourage others]
 
Share this answer
 
v2
Comments
[no name] 5-Feb-14 9:17am    
Yes - Using V1.6.2 works like my old code using V1.4.2. Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900