定义 jquery 插件
我在定义 jquery 插件时遇到问题。在 asp.net 页面中,位于 RadAjaxPanels,其中加载了小部件(asp.net 控件)。在小部件中,我定义了 jquery 插件:
<script src="../../JS/jquery-1.5.1.js" type="text/javascript"></script>
<script src='../../JS/jquery-ui-1.8.16.custom.min.js' type="text/javascript"></script>
<script src="../../JS/ui.spinner.min.js" type="text/javascript"></script>
<script src="../../JS/jquery.blockUI.js" type="text/javascript"></script>
<script src="../../JS/jquery.json-2.2.min.js" type="text/javascript"></script>
但在第一次应用于插件时(例如 $('#tReports').unblock()
),会出现错误:“对象不支持属性或方法“解锁””。 可能是因为与Telerik控件中定义的jquery冲突。 Jquery 对象工作正常。请帮忙:)
I have a problem with defining jquery plugins. In asp.net page located RadAjaxPanels, in which are loaded widgets (asp.net controls). In the widget I define jquery plugins:
<script src="../../JS/jquery-1.5.1.js" type="text/javascript"></script>
<script src='../../JS/jquery-ui-1.8.16.custom.min.js' type="text/javascript"></script>
<script src="../../JS/ui.spinner.min.js" type="text/javascript"></script>
<script src="../../JS/jquery.blockUI.js" type="text/javascript"></script>
<script src="../../JS/jquery.json-2.2.min.js" type="text/javascript"></script>
But at the first applying to the plug-in (eg $('#tReports').unblock()
) an error occurs: "Object doesn't support property or method 'unblock'".
Maybe it's because conflicts with jquery defined in Telerik control. Jquery object works properly. Please help :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您不止一次包含 jQuery,并且您用来调用
unblock()
的 jQuery 实例不是插件扩展的实例。可能来自 telerik,但也可能来自使用 jQuery 脚本块的多个用户控件。您需要放置一个系统以确保脚本包含的正确组合(如 WebForms 中的 ScriptManager 或 RadScriptManager)。
It sounds like you're including jQuery more than once, and the instance of jQuery that you're using to call
unblock()
is not the one the plug-in has extended. Possibly from telerik, but also possibly from having multiple user controls with jQuery script blocks.You need to put a system in-place to ensure proper composition of script includes (like ScriptManager or RadScriptManager in WebForms) .