2013-02-28 88 views
0

我有一個問題,使用自動完成與其他JavaScript庫,我需要在我的項目中一起使用。與.net mvc JQuery自動完成問題

當我運行這個簡單的例子,它在第一次正常工作。它顯示完美的自動完成窗口,但如果我嘗試更改單詞我輸入它會在Chrome中生成此錯誤:

未捕獲的ReferenceError:pos未定義在文件jquery-1.4.4-vsdoc.js: 2495

這是代碼:

$(function() { 
     var availableTags = [ 
      "ActionScript", 
      "AppleScript", 
      "Asp", 
      "BASIC", 
      "C", 
      "C++", 
      "Clojure", 
      "COBOL", 
      "ColdFusion", 
      "Erlang", 
      "Fortran", 
      "Groovy", 
      "Haskell", 
      "Java", 
      "JavaScript", 
      "Lisp", 
      "Perl", 
      "PHP", 
      "Python", 
      "Ruby", 
      "Scala", 
      "Scheme" 
     ]; 
     $("#txtPesquisar").autocomplete({ 
      source: availableTags 
     }); 
    }); 

,我帶領我的母版頁所有這些JavaScript的爲我的項目。

我不知道爲什麼我得到這個錯誤。

<link href="<%= Url.Content("~/Content/jquery-ui-1.10.1.custom.css") %>" rel="stylesheet" type="text/css" /> 

<script src="<%= Url.Content("~/Scripts/jquery-1.9.1.js") %>" type="text/javascript"></script>  
<script src="<%= Url.Content("~/Scripts/jquery-1.4.4-vsdoc.js") %>" type="text/javascript"></script> 
<script src="<%= Url.Content("~/Scripts/Utils.js") %>" type="text/javascript"></script> 
<script src="<%= Url.Content("~/Scripts/jquery.form.js") %>" type="text/javascript"></script> 
<script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>   

<script src="<%= Url.Content("~/Scripts/jquery-ui.js")%>" type="text/javascript"> </script> 
<script src="<%= Url.Content("~/Scripts/JuridicOffice.js") %>" type="text/javascript"></script> 


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

<script src="<%= Url.Content("~/Uploadify/swfobject.js") %>" type="text/javascript"></script> 
<script src="<%= Url.Content("~/Uploadify/jquery.uploadify.v2.1.4.min.js") %>" type="text/javascript"></script>  

<script src="<%= Url.Content("~/Scripts/jgcharts.js") %>" type="text/javascript"></script>  
<script src="<%= Url.Content("~/Scripts/Mascara.js") %>" type="text/javascript"></script> 
<script src="<%= Url.Content("~/Scripts/jquery.maskedinput-1.3.js") %>" type="text/javascript"></script> 
<script src="<%= Url.Content("~/Scripts/jquery.color.js") %>" type="text/javascript"></script> 
<script src="<%= Url.Content("~/Scripts/jquery.Jcrop.min.js") %>" type="text/javascript"></script> 

我在這裏紅色的東西在論壇上它可能是一個回發函數,但我不知道如何弄清楚。

感謝您的幫助

回答

2

您注意到了嗎?文件vsdoc比jQuery版本稍舊,即使你應該從運行時版本中刪除vsdoc.js。

如果打開vsdoc,您可以在此註釋中找到。

/* 
* This file has been commented to support Visual Studio Intellisense. 
* You should not use this file at runtime inside the browser--it is only 
* intended to be used only for design-time IntelliSense. Please use the 
* standard jQuery library for all production use. 
* 
* Comment version: 1.4.4a 
*/