gpt4 book ai didi

javascript - 如何刷新jquery对话框以供下次使用?

转载 作者:行者123 更新时间:2023-12-02 20:18:13 26 4
gpt4 key购买 nike

您好,我正在使用 div 内容推送 jquery 对话框。第二次打开后,我想使用与 div 相同的内容刷新对话框,而不影响我的代码。我该怎么做?请帮助我..代码如下:

Jquery 对话框代码:

$(function() {
$( "#atendeePopup" ).dialog({
autoOpen: false,
width:610,
height:680,
show: "fold",
hide: "core"
});

$('.flora.ui-dialog').css({position:"fixed"});

$( "#widgetAtendeeIcon").click(function() {
$( "#atendeePopup" ).dialog( "open" );
return false;
});
});

html代码:

<div id=""#atendeePopup" >
<p>My div content here</>
</div>

最佳答案

我假设刷新你的意思是放回原始数据,我们在这里:

$(function () {
if ($("#atendeePopup").data('orig') == undefined) {
$("#atendeePopup").data('orig', $("#atendeePopup").html());
}
$("#atendeePopup").dialog({
autoOpen: false,
width: 610,
height: 680,
show: "fold",
hide: "core"
});
$('.flora.ui-dialog').css({
position: "fixed"
});

$("#widgetAtendeeIcon").click(function () {
if ($("#atendeePopup").data('orig') != undefined) { //update to orig
$("#atendeePopup").html($("#atendeePopup").data('orig'));
}
$("#atendeePopup").dialog("open");
return false;
});
});

关于javascript - 如何刷新jquery对话框以供下次使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5938056/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com