Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/429.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何创建预先描述的iframe模式表单?_Javascript_Jquery_Jsp - Fatal编程技术网

Javascript 如何创建预先描述的iframe模式表单?

Javascript 如何创建预先描述的iframe模式表单?,javascript,jquery,jsp,Javascript,Jquery,Jsp,我有一个名为makeIframeModal.js的js文件。通常,当我尝试创建iframe时,会在jsp中使用iframe标记,如下所示: <iframe id="myIframeId" style="display:none;" height="430" width="675" src="myjsp.jsp" ></iframe> iframemodal = new modal($('framebtn'), { afterOpen : function(){$$('

我有一个名为makeIframeModal.js的js文件。通常,当我尝试创建iframe时,会在jsp中使用iframe标记,如下所示:

<iframe id="myIframeId" style="display:none;" height="430" width="675" src="myjsp.jsp" ></iframe>
iframemodal = new modal($('framebtn'), {

afterOpen : function(){$$('.close a').invoke('observe','click',function(e){modal.close(); Event.stop(e);});},
opacity: 0.3,
width: 675,
fade: true,
fadeDuration: 0.1,
autoOpenIfLinked: false

});
function closeMyIframe()
{
var parentDynamicDiv = window.parent.document.getElementById('dynamic_id1');
var iframe = window.parent.document.getElementById('dynamic_id2');
iframe.style.display = 'none';
parentDynamicDiv.style.display = 'none';
}
因此,我的iframe会弹出一个窗口。现在我在这个iframe中有一个链接,单击它将关闭iframe。我是这样做的:

<iframe id="myIframeId" style="display:none;" height="430" width="675" src="myjsp.jsp" ></iframe>
iframemodal = new modal($('framebtn'), {

afterOpen : function(){$$('.close a').invoke('observe','click',function(e){modal.close(); Event.stop(e);});},
opacity: 0.3,
width: 675,
fade: true,
fadeDuration: 0.1,
autoOpenIfLinked: false

});
function closeMyIframe()
{
var parentDynamicDiv = window.parent.document.getElementById('dynamic_id1');
var iframe = window.parent.document.getElementById('dynamic_id2');
iframe.style.display = 'none';
parentDynamicDiv.style.display = 'none';
}
但是,现在我需要打开另一个iframe,名为myNewIframeModal


简而言之:当我关闭第一个iframe时,另一个iframe必须自动弹出。如何实现此功能?请帮帮我。

您可以调用closeMyframe中的新模式

function closeMyIframe()
{
var parentDynamicDiv = window.parent.document.getElementById('dynamic_id1');
var iframe = window.parent.document.getElementById('dynamic_id2');
iframe.style.display = 'none';
parentDynamicDiv.style.display = 'none';

iframemodal2 = new modal($('framebtn'), {

afterOpen : function(){$$('.close a').invoke('observe','click',function(e){modal.close(); Event.stop(e);});},
opacity: 0.3,
width: 675,
fade: true,
fadeDuration: 0.1,
autoOpenIfLinked: false

});

}

在何处以及如何添加jsp,它将包含新模式的内容。此外,我尝试了这种方式,在旧模式关闭后,新模式不会弹出。请使用???向我提供模式库。你编写代码的方式无助于创建新的弹出窗口。。