【发布时间】:2012-11-23 20:01:31
【问题描述】:
我的页面中的div 中有一个iframe,如下所示:
<div id="ModalContato" style="display: none; text-align: center;">
<iframe id="IfrModalContato" frameborder="0" scrolling="yes" src="" style="width: 100%;
height: 100%;"></iframe>
</div>
在我的页面中有一个网格内的按钮调用此函数:
function AbreModalContato() {
$("#IfrModalContato")[0].src = "ContatoModal.aspx?Modal=1&IdContatoPai=" + $("#ctl00_Corpo_HidIdContato").val();
$("#ModalContato").dialog({ modal: true, title: 'Cadastro de contatos', width: 970, height: 570 });
$("#ModalContato").dialog('open');
}
当我点击打开模式的按钮时,我收到很多 JS 错误,例如:
'Array' is not defined
'Object' is not defined
'Function' is not defined
在this question 上,有一个人似乎和我一样有问题(我的问题也只发生在 IE9 上),但作为 JS 和 jQuery 的菜鸟,我不知道如何使我的代码适应他所说的.
我尝试过这样的事情:
function onShow() {
$("#IfrModalContato").attr("src", "ContatoModal.aspx?Modal=1&IdContatoPai=" + $("#ctl00_Corpo_HidIdContato").val());
$("#ModalContato").dialog({ modal: true, title: 'Cadastro de contatos', width: 970, height: 570 });
$("#ModalContato").dialog('open');
}
但这对我不起作用。 有人吗?
谢谢。
【问题讨论】:
-
你能在 jsfiddle 上发帖吗?因此我们将更容易编辑和测试您的代码。谢谢
-
嗯,我正在使用 asp.net,我只知道 jsfiddle 执行 js 代码,但老实说,我不知道如何将我的代码粘贴到那里以使其运行。如果我在这里粘贴我所有页面的代码会对您有所帮助吗?
-
我为你做了一个 jsfiddle。 Here 但是不知道为什么说函数没有定义。我很困惑:/
标签: javascript jquery asp.net internet-explorer-9