JQueryUI 自动完成与遗留代码冲突
我的问题是。我的 jQueryUI 版本为 1.8.5,项目中有很多遗留源代码。在遗留代码中,碰巧有 3 次注册的 jquery 插件自动完成。然而 jQueryUI 正在注册相同的插件。所以当我输入我的 javascript 时:
$('#some_id').autocomplete();
它实际上不是 jQueryUI。
有机会明确选择 UI 吗?
我尝试了这样的方法:
jQuery.fn.myautocomplete = jQuery.ui.autocomplete
然后在我的代码中使用:
$('#some_id').myautocomplete();
但这不起作用。 (嗯,这是一个盲目的拍摄,所以我没有期望太多。)
任何如何解决这个问题的建议。
PS 遗留代码受到教皇的祝福,明年左右无法删除。
My issue is. I have jQueryUI in version 1.8.5 and lot and a lot of legacy source code in a project. In legacy code it happens that there is 3ple times registred plugin autocomplete for jquery. However jQueryUI is registring the very same plugin. So when I type into my javascript:
$('#some_id').autocomplete();
It's not actually a jQueryUI.
Any chance to explicit choose UI?
I tried such approach:
jQuery.fn.myautocomplete = jQuery.ui.autocomplete
And then to use in my code:
$('#some_id').myautocomplete();
But this does not work. (Well it was a blind shoot so I did not expect to much.)
Any suggestion how to workaround the problem.
P.S.
Legacy code is blessed by the Pope and cannot be removed for next year or so.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以:
You can: