我正在尝试使用jQuery Columnizr插件。这是我的代码(简体,完整版本在截图中)
<html lang="en" class="no-js">
<head runat="server">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title><%: Page.Title %></title>
<webopt:bundlereference runat="server" path="~/Content/css" />
<link href="App_Themes/MetroTouchCountries/TabStrip.MetroTouchCountries.css" rel="stylesheet" />
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<script src="Scripts/jquery-2.1.1.min.js"></script>
<script src="Scripts/jquery.columnizer.js" type="text/javascript"></script>
<!-- Use this script to support CSS3 multi column feature in IE 7, 8, 9 -->
<script src="Scripts/modernizr.custom.61385.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('.sutunlar').columnize({ columns: 3 });
});
</script>
</head>
<body>
这是我得到的错误:
http:/ xx /
第29行第13行未处理的异常0x800a01b6 - JavaScript运行时错误:对象不支持属性 或方法'columnize'
答案 0 :(得分:1)
原因是<body>
中的 ScriptManager (很抱歉,我的问题中没有包含<body>
)。 jquery和bootstrap定义与<head>
中的脚本引用冲突。我在ScriptManager中注释掉了两行,问题就消失了。
<asp:ScriptManager runat="server">
<Scripts>
<%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=301884 --%>
<%--Framework Scripts--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<%-- <asp:ScriptReference Name="jquery" /> --%>
<%-- <asp:ScriptReference Name="bootstrap" /> --%>
<asp:ScriptReference Name="respond" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--Site Scripts--%>
</Scripts>
</asp:ScriptManager>