jQuery 对话框窗口无法打开
我通常不会只是发布代码并说“帮助”,但我觉得我已经用尽了每一次搜索。任何关于为什么这不起作用的帮助将不胜感激。我没有收到任何类型的 Javascript 错误,只是当我单击我设置的链接时,窗口没有打开。
function openDialog()
{
jQuery('#GREWaiverTable').show();
jQuery('#GREWaiverTable').dialog('open');
}
jQuery(document).ready(function() {
jQuery('body').append('<div id="GREWaiverTable" title="Am I required to take the GRE?"></div>');
jQuery('#GREWaiverTable').load('grewaivertable.cfm?ajax=1')
jQuery('#GREWaiverTable').dialog({
autoOpen:false,
width:600,
modal:true,
resizable:true,
overlay: {
backgroundColor: '#000',
opacity: 0.7
}
});
jQuery('#grewaiverlink').click(function() {
openDialog();
});
});
和 HTML:
<a id="grewaiverlink">Am I required to take the GRE?</a>
I'm not usually one to just post code and say "help", but I feel like I've exhausted every search. Any help as to why this doesn't work would be greatly appreciated. I'm not getting any type of Javascript errors, the window just doesn't open when I click on the link I set up.
function openDialog()
{
jQuery('#GREWaiverTable').show();
jQuery('#GREWaiverTable').dialog('open');
}
jQuery(document).ready(function() {
jQuery('body').append('<div id="GREWaiverTable" title="Am I required to take the GRE?"></div>');
jQuery('#GREWaiverTable').load('grewaivertable.cfm?ajax=1')
jQuery('#GREWaiverTable').dialog({
autoOpen:false,
width:600,
modal:true,
resizable:true,
overlay: {
backgroundColor: '#000',
opacity: 0.7
}
});
jQuery('#grewaiverlink').click(function() {
openDialog();
});
});
And the HTML:
<a id="grewaiverlink">Am I required to take the GRE?</a>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现一个可能的问题:
##GREWaiverTable
应该只有一个哈希符号#GREWaiverTable
。这就是引用 ID 属性的方式。另外,您是否使用 Fiddler 或 Firebug 来确保对
grewaivertable.cfm?ajax=1
的调用正在发生?I see a possible issue:
The
##GREWaiverTable
should only have one hash symbol#GREWaiverTable
. That is how you reference an ID attribute.Also, are you using Fiddler or Firebug to ensure the call to the
grewaivertable.cfm?ajax=1
is happening?