我創建了一個非常小的mvc4互聯網應用程序,在主頁上有一個自動完成文本框。一切正常,直到我使用的NuGet軟件包管理器1.8.2版本更新jQuery的,從那以後,我得到一個Microsoft JScript runtime error: Object doesn't support this property or method
錯誤此函數拋出:在jquery-ui-1.8.20.js
文件錯誤安裝jquery包後
function reduce(elem, size, border, margin) {
$.each(side, function() {
size -= parseFloat($.curCSS(elem, "padding" + this, true)) || 0;
if (border) {
size -= parseFloat($.curCSS(elem, "border" + this + "Width", true)) || 0;
}
if (margin) {
size -= parseFloat($.curCSS(elem, "margin" + this, true)) || 0;
}
});
return size;
。
這是我叫我在_Layout.cshtml
網頁腳本和樣式:
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/themes/base/css")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
@RenderSection("scripts", required: false)
,並與文本框的主頁:
@using (Html.BeginForm("AutoComplete", "Home", FormMethod.Get, new { style = "text-align: center;" }))
{
<input type="text" id="autocomplete" name="key" data-autocomplete=" @Url.Action("AutoCompleteData", "Home")" />
}
@section scripts{
<script type="text/javascript">
$(document).ready(function() {
$('#autocomplete').each(function() {
$(this).autocomplete({
source: $(this).attr('data-autocomplete')
});
});
});
</script>
}
我試圖改變的順序腳本和樣式調用但它沒有幫助。
相同的代碼在更新之前完美工作。
任何幫助,將不勝感激。
編輯: 我下載了最新的jquery-ui文件,並將它們添加到我的項目中。我現在沒有收到任何錯誤,但當輸入文本框時,它看起來像這樣:
(建議隱藏文本框的一部分,子彈是可見的), 刷新後建議位於罰款,但子彈仍然可見。