【问题标题】:Trying to use jQuery Columnizr plugin: "Object doesn't support property > or method 'columnize'"尝试使用 jQuery Columnizr 插件:“对象不支持属性 > 或方法 'columnize'”
【发布时间】:2014-10-31 17:45:00
【问题描述】:

我正在尝试使用 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 运行时错误:对象不支持属性 或方法“列”

【问题讨论】:

  • 您能否确保正在加载 Columnizer? (使用 F12 的网络工具)确保 JavaScript 文件没有丢失,或者没有任何格式错误(例如,从 GitHub 下载 .js 文件时会发生这种情况)。
  • 好点,但没用。 F12 表示文件已加载。我又下载了。还尝试使用 CDN (//cdn.jsdelivr.net/jquery.columnizer/1.6.0/jquery.columnizer.js)。相同的消息

标签: jquery internet-explorer-9 multiple-columns


【解决方案1】:

原因是&lt;body&gt; 中的ScriptManager(抱歉,我的问题中没有包含&lt;body&gt;)。 jquery 和 bootstrap 定义与我在 &lt;head&gt; 中的脚本引用冲突。我在 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>

【讨论】:

    猜你喜欢
    • 2015-11-21
    • 2013-03-23
    • 1970-01-01
    • 2019-03-29
    • 2018-01-11
    • 2011-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多