尝试使用jQuery Columnizr插件:“对象不支持属性>或方法'columnize' [英] Trying to use jQuery Columnizr plugin: "Object doesn't support property > or method 'columnize'"

查看:98
本文介绍了尝试使用jQuery Columnizr插件:“对象不支持属性>或方法'columnize'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用jQuery Columnizr插件.这是我的代码(简化版,完整版本在屏幕截图中)

I'm trying to use jQuery Columnizr plugin. Here is my code (simplified, full version is in screenshot)

<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/

Unhandled exception at line 29, column 13 in http:/xx/

0x800a01b6-JavaScript运行时错误:对象不支持属性 或方法'columnize'

0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'columnize'

推荐答案

原因是<body>中的 ScriptManager (很抱歉,我没有在问题中加入<body>). jQuery和Bootstrap定义与<head>中的脚本引用冲突.我在ScriptManager中注释了两行,问题就消失了.

The reason is ScriptManager in <body> (Sorry that I didn't include <body> in my question). jquery and bootstrap definitions were conflicting with my script references in <head>. I commented out two lines in ScriptManager and the problem went away.

    <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>

这篇关于尝试使用jQuery Columnizr插件:“对象不支持属性&gt;或方法'columnize'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆