DataTables 和 jquery 添加模式来编辑/删除每行中的链接
我是一个新手,所以如果这是一个简单的问题,请原谅我。
我试图显示一个 jquery 确认框,但运气不佳。常规的 javascript 工作正常。
我正在使用 DataTables,并在最后一列有 2 个图像右边,一个编辑,另一个删除。
我尝试了一个简单的对话框:
` $('#datatable tbody tr a.delete img').live( 'click', function () {
$( "#dialog" ).dialog();
});`
在 html 中,我有一个带有对话框 id 的 div tage..但是当我单击链接时,我收到一条错误消息“$("#dialog").dialog 不是一个函数”
我有用谷歌搜索这个错误,没有运气。有人有什么想法吗?
I am a newbie so please forgive me if this is an easy one..
I am trying to dislay a jquery confirmation box without much luck.. The regular javascript works fine..
I am using DataTables and have 2 images on the last column on the right, one edit and the other delete.
I tried a simple dialog as:
` $('#datatable tbody tr a.delete img').live( 'click', function () {
$( "#dialog" ).dialog();
});`
In the html I have a div tage with the id of dialog.. but when I click the link I get an error saying "$("#dialog").dialog is not a function"
I have googled this error to death with no luck.. Anyone have any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
$.dialog()
是 jQuery UI 插件的一部分。你在这里有一个演示: http://jqueryui.com/demos/dialog/
加载 jQuery,然后jQueryUI 然后你的脚本:
$.dialog()
is part of the jQuery UI plugin.You got a demo here : http://jqueryui.com/demos/dialog/
Load jQuery, then jQueryUI then your script :