我在jQuery Dialog
中加载页面。 ajax命令完成后,我希望能够重新加载jQuery Dialog
中的同一页面。如何从Dialog
中加载的页面内重新加载jQuery Dialog
?如何从对话框中重新加载jQuery对话框?
父页(Blah.aspx):
<script type="text/javascript">
function view_dialog() {
$('#dialog').load('blah2.aspx').dialog({
title: 'test' ,
modal: 'true',
width: '80%',
height: '740',
position: 'center',
show: 'scale',
hide: 'scale',
cache: false });
}
</script>
<asp:Content
ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
<input id="Button1" onclick="view_dialog()" type="button" value="button" />
<div id="dialog" style="display: none"></div>
</asp:Content>
对话内容页面(blah2.aspx):
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
$(document).ready(function() {
function doit() {
var request = $.ajax({
url: "someurl",
dataType: "JSON",
data: {
a: 'somevalue'
}
});
request.done(function() {
//refresh the current dialog by calling blah2.aspx again
});
}
</script>
<asp:Content
ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1"
runat="server">
<input id="Button1" onclick="doit()" type="button" value="button" />
</asp:Content>
谢谢!我知道这已经过了4年,但是你的代码非常帮助我! – Markoh