javascript 对象不支持属性或方法“nestedSortable”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15958818/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 02:44:50  来源:igfitidea点击:

Object doesn't support property or method 'nestedSortable'

javascriptjqueryinternet-explorernested-sortable

提问by user1696090

Having an IE9 issue that is really, really breaking me down mentally. Cannot figure it out! I really hate how we have to deal with these IE issues.

有一个 IE9 问题,真的,真的让我精神崩溃。想不通!我真的很讨厌我们如何处理这些 IE 问题。

I've gone through about 20 pages on Google looking for an answer and nothing works. I have a form that you can create a "Section". These sections can then be reordered using the jquery nestedSortable plugin. http://mjsarfatti.com/sandbox/nestedSortable/

我在谷歌上浏览了大约 20 页寻找答案,但没有任何效果。我有一个表格,您可以创建一个“部分”。然后可以使用 jquery 嵌套排序插件对这些部分进行重新排序。 http://mjsarfatti.com/sandbox/nestedSortable/

In IE9, nothing works. I cannot create sections or reorder them, I get the following error upon loading the page:

在 IE9 中,没有任何效果。我无法创建部分或对它们重新排序,加载页面时出现以下错误:

SCRIPT438: Object doesn't support property or method 'nestedSortable'

SCRIPT438:对象不支持属性或方法“nestedSortable”

It states the error has to do with the second character in this:

它指出错误与此中的第二个字符有关:

$('#sortable').nestedSortable({
    //disableNesting: 'no-nest',
    listType: 'ul',
    forcePlaceholderSize: true,
    handle: 'div',
    helper: 'clone',
    items: 'li',
    maxLevels: 2,
    opacity: .6,
    placeholder: 'placeholder',
    revert: 250,
    tabSize: 25,
    tolerance: 'pointer',
    toleranceElement: '> div',
    update: function(){
        order_sections();
    }
});

Any ideas? If I completely remove this block of code, I get no errors and I can create sections fine, I can of course not reorder them because this is commented out.

有任何想法吗?如果我完全删除此代码块,则不会出现任何错误,并且可以很好地创建部分,当然我不能重新排序它们,因为这已被注释掉。

This works great in ALL browser but IE9. Not sure if it works in older version, we only support IE9 because we have to. I wish we could just block all of IE from our application since it is a gigantic garbage dump.

这在所有浏览器中都很好用,但 IE9。不确定它是否适用于旧版本,我们只支持 IE9,因为我们必须这样做。我希望我们可以从我们的应用程序中阻止所有 IE,因为它是一个巨大的垃圾转储。

Sorry to come here with a boring IE issue but I'm out of ideas, 3 hours deep into this and I've made no progress.

很抱歉带着一个无聊的 IE 问题来到这里,但我没有想法,深入研究了 3 个小时,但我没有取得任何进展。

I do see the compatibility for this plugin is IE6/7/8 and he doesn't mentioned 9.

我确实看到这个插件的兼容性是 IE6/7/8 而他没有提到 9。

EDITED***

编辑***

My javascript files are being included in the footer, here is there order:

我的 javascript 文件被包含在页脚中,这里有顺序:

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

<script type="text/javascript" src="js/public/website/application.js?v=1362424015"></script>

<script type="text/javascript" src="js/public/website/bootstrap.js?v=1364410348"></script>

<script type="text/javascript" src="js/public/website/greyScale.js?v=1362424015"></script>

<script type="text/javascript" src="js/public/website/jquery.placeholder.js?v=1362424015"></script>

<script type="text/javascript" src="/js/public/website/jquery.dataTables.js?v=1362424015"></script>

<script type="text/javascript" src="js/common/jquery-ui-1.9.0.custom.min.js?v=1362424015"></script>

<script type="text/javascript" src="js/members/global.js?v=1364396131"></script>

<script type="text/javascript" src="http://dev.clientsky.com/js/members/proposals/proposal.js?v=1364351236"></script>

<script type="text/javascript" src="js/members/proposals/create_proposal_sections.js?v=1365712158"></script>

<script type="text/javascript" src="js/common/jquery.mjs.nestedSortable.js?v=1362424015"></script>  

Everything looks good to me and this is a large application and this is the first time we're seeing a problem like this with one of the plugins.

对我来说一切都很好,这是一个大型应用程序,这是我们第一次看到其中一个插件出现这样的问题。

回答by user1696090

Ahh ha solved this, I was loading the javascript file with the above code BEFORE the nestedSortable.js file, just had to switch the two. thanks!

啊已经解决了这个问题,我在nestedSortable.js文件之前用上面的代码加载了javascript文件,只需要切换两者。谢谢!