【问题标题】:In ie8 jquery error(The value of the property '$' is null or undefined, not a Function object)在ie8 jquery中报错(属性'$'的值为null或未定义,不是Function对象)
【发布时间】:2016-05-03 09:51:31
【问题描述】:

在ie8 jquery中报错(属性'$'的值为null或undefined,不是Function对象)

这个错误只出现在 ie8 中,chrome 和 firefox 工作正常。

$(document).ready(function (e) {
        $('#otp').bind("cut copy paste", function (e) {
            e.preventDefault();
        });

        $('#dropdown').on('click', function () {
            $('.dropdownwrap').slideToggle();
        });

    $(window).load(function () {
        $('#preloader').fadeOut('slow', function () {
                $(this).remove();
            });
        });
    });

【问题讨论】:

标签: javascript jquery internet-explorer-8


【解决方案1】:

在最新版本的 chrome 和 FF [也许还有 Safari] 中原生支持“$”。

IE 9 本身不支持此功能,因此您会收到您所说的错误。

我强烈建议在您的页面中包含 jQuery 并再次尝试该代码。

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

在你的页面中包含这个 jquery

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-28
    • 1970-01-01
    • 2013-09-15
    • 2014-07-10
    • 2013-12-21
    • 1970-01-01
    相关资源
    最近更新 更多