gpt4 book ai didi

javascript - 如何从 Fancybox 返回值

转载 作者:行者123 更新时间:2023-11-28 02:40:30 24 4
gpt4 key购买 nike

我有一个 Fancybox,它打开另一个 aspx.page,将 DropDownList 加载到 fancybox 中。然后我需要用户从列表中选择一个值。我想知道是否可以将所选值返回到我调用 fancybox 的页面。

例如:我在 website/test1.aspx。 Test1.aspx 调用 fancybox,在 fancybox 中加载 Test2.aspx。 Test2.aspx有ddl,用户从ddl中选择一个值,然后fancybox关闭并将所选值返回给Test1.aspx

这是我的幻想盒:

$.fancybox({
'autoScale': false,
'type': 'iframe',
'height': 800,
'width': 800,
'href': 'Utilities/MoveFileTemplate.aspx?ExpenseID=' + $(this).children(':first').html(),
onComplete: function () {
$('#fancybox-overlay').unbind();
}
});

在 MovingFileTemplate.aspx 中,我有一个隐藏字段,它从 DropDownList 中分配选定的值

最佳答案

fancybox iframe页面中的代码:

window.top.DoSomethingWithValue($('#myddl').val());

顶部(开启)页面中的代码:

function DoSomethingWithValue(val)
{
alert(val);
}

关于javascript - 如何从 Fancybox 返回值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12729534/

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