0
我使用jquery模式poup打开一个页面(从父页面,a.spx,IAM打开子页面,b.aspx例子。)关闭按钮点击
以下是代码
<script type="text/javascript">
$(function() {
$("[id$='lnkbtn']").click(function() {
var str = $(this).attr("details");
var page = ('../b.aspx?no=' + str);
var $dialog = $('<div></div>').html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>').dialog({ autoOpen: false, modal: true, height: 500, width: 900});
$dialog.dialog('open');
});
});
</script>
我想在用户单击模式弹出窗口(IE b.aspx)上的关闭按钮(x)时刷新我的父页面。
我去了以下链接,但我没有得到预期的操作。
下面是根据我的需求量的修改后的代码。
<script type="text/javascript">
$(function() {
$('#dialog').dialog({
open: function() //runs every time this dialog is opened
{
//var $dialog = $(this);
var page = ('../../a/bc.aspx');
var $dialog = $('<div></div>').html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>').dialog({ autoOpen: false, modal: true, height: 650, width: 1000 });
if (!$dialog.data('titleCloseBound')) {
$dialog
.data('titleCloseBound', true) //flag as already bound
.closest('div.ui-dialog') //traverse up to the outer dialog wrapper
.find('a.ui-dialog-titlebar-close') //search within it for the X
.bind('click', function(e) //bind it
{
alert('hi');
e.preventDefault();
__doPostBack('', '');
});
}
}
});
});
THKS我试过,但reslt相同 –
原因是IAM的模式打开网页popup –
我不知道究竟是什么__doPostBack('','');剂量,但我更新你的小提琴页和关闭事件工作得很好,我不知道什么选择你什么? – Exlord