0
我試圖使用自動完成功能,它不適用於VS2012。所以,我從jQuery(http://jqueryui.com/autocomplete/#default)中抽取了一個樣本,並將其粘貼到VS2012和VS2010中。它在2010年工作正常,但在2012年拋出異常。jquery自動完成不在VS2012中工作,但在VS2010中正常工作
任何想法爲什麼會發生這種情況?
爲了避免任何插件或腳本不匹配的情況,我使用了jQuery站點給出的cdn引用。
這是我用過的源代碼。這是唯一的內容,並沒有別的在VS2012中添加和VS2010
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Autocomplete - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.1/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(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"
];
$("#tags").autocomplete({
source: availableTags
});
});
</script>
</head>
<body>
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags" />
</div>
</body>
</html>
編輯: 我觀察到,在VS2012它連接默認的佈局,如果沒有提到。同樣,如果我們刪除「@RenderSection(」腳本「,false);」在layout.cshtml文件中,事情將開始工作。
任何人都知道這是爲什麼?
拋出什麼異常? –
我收到以下異常:http:// localhost:36461/home/test 0x800a01b6中第69行第9列未處理的異常:Microsoft JScript運行時錯誤:對象不支持此屬性或方法 – sam113