Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
63
rated 0 times [  68] [ 5]  / answers: 1 / hits: 54708  / 14 Years ago, sun, november 14, 2010, 12:00:00

I just switched my App to run on MVC3 and the Razor view engine, and now I'm getting a JavaScript error. The thing is, nothing has changed on the JavaScript side of things... it worked before.



Here's the code



<script type=text/javascript src=http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js></script>
<script type=text/javascript>
var json_region = [{value:365,label:Calgary},{value:368,label:Canmore},{value:393,label:Edmonton}]
$(function() {
$('#UserRegion').autocomplete({
source: json_region,
selectFirst: true,
select: function( event, ui ) {
$('#RegionID').val( ui.item.value );
$('#UserRegion').val( ui.item.label );
return false;
}
});
});
</script>

<script type=text/javascript src=/Extras/urbannow.js/1></script>
<script src=/Assets/Scripts/jquery.ui.autocomplete.selectfirst.js type=text/javascript></script>
<script src=/Assets/Scripts/wmd.js type=text/javascript></script>
<script src=/Assets/Scripts/showdown.js type=text/javascript></script>
<script src=http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js></script>
<script src=http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js></script>
<script src=/Assets/Scripts/jquery.validate.unobtrusive.min.js type=text/javascript></script>


And this is erroring



$('#UserRegion').autocomplete({


The console says




SCRIPT438: Object doesn't support this property or method




And I just can't figure this one out.


More From » jquery

 Answers
16

You're including jQuery twice.


[#94966] Friday, November 12, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
skylerselenem

Total Points: 282
Total Questions: 101
Total Answers: 107

Location: Nicaragua
Member since Tue, Dec 8, 2020
4 Years ago
;