我有一个 jquery 对话框,当我打开和关闭它时,转到另一个页面,然后使用浏览器返回按钮返回,对话框再次显示。这发生在 Chrome 和 IE 中,而不是 Firefox 中。我可以对对话框进行哪些修改?谢谢!
<td class ="approval-img"><asp:ImageButton runat="server" CommandArgument = '<%# Eval("aux_approvalId")%>' OnClick="getApprovalID_approve" ToolTip="Approve" ImageUrl="/Images/Approve.png" /></td>
protected void getApprovalID_approve(object sender, EventArgs e)
{ .....
string script = "OpenApprovalDialog();";
Page.ClientScript.RegisterStartupScript(typeof(Page), "", script, true);
}
这些是打开/关闭对话框的功能:
function OpenApprovalDialog() {
$.blockUI({ message: $('#approval-form'), baseZ: 10000 });
$('#approval-form').parent().appendTo($("form:first"));
return false;
};
$('#btnCancelApprove').click(function () {
$.unblockUI();
$("#approval-form").parent().detach();
return false;
});
以及打开的对话框:
<div id="approval-form" style="display: none; cursor: default" title="Approve">
<div class="approve-change">
<ul>
<li>
<p><label>Approve change: </label><label>Reason</label></p>
<textarea id="txtReasonApprove" runat="server" cols="1" rows="1" class="required"></textarea><br />
</li>
<li>
<span>
<button id="btnCancelApprove" class="blue-problem">Cancel</button>
<asp:Button ID="btnApprove" runat="server" CssClass="blue-problem" Text="Approve" ToolTip = "Approve" OnClick="ApproveChange_Click"/>
</span>
</li>
</ul>