问题描述
我正在尝试从iframe打开一个jquery ui对话框。当单击按钮打开对话框时,对话框假设在iframe上显示为bootstrap模式。
我遇到的问题是当我单击一个按钮打开对话框,打开对话框中其他文件的整个页面。
我尝试了什么:
myIframeFile.asp:
< iframe id =myiframesrc =myFileToOpenTheDialogBox.asp ?a =<%= Request.QueryString(a)%>>< / iframe>
myFileToOpenTheDialogBox.asp:
< button id =btnOptions>选项< / button>
< div id =dialogtitle =Optionsstyle =display:none;>
< form>
...
< / form>
< / div>
< script> ;
I am trying to open a jquery ui dialog box from an iframe. When the button is clicked to open the dialog box, the dialog box is suppose to display over the iframe like a bootstrap modal.
The problem I am having is when I click a button to open the dialog box it opens the entire page of the other file inside the dialog box.
What I have tried:
myIframeFile.asp:
<iframe id="myiframe" src="myFileToOpenTheDialogBox.asp?a=<%=Request.QueryString("a")%>"></iframe>
myFileToOpenTheDialogBox.asp:
<button id="btnOptions">Options</button>
<div id="dialog" title="Options" style="display:none;">
<form>
...
</form>
</div>
<script>
$(document).ready(function(){
$("#btnOptions").click(function(){
$("#myiframe", window.parent.document).dialog({
width:800,
resizable: true
});
});
});
< / script>
</script>
推荐答案
< / script>
</script>
这篇关于如何在单击事件上从iframe打开jquery ui对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!