【发布时间】:2014-10-27 15:29:42
【问题描述】:
我在fancybox(2) iframe 中有一个测验,完成后我在Fancybox 页面上的隐藏文本框中保存了一个分数:
<form>
<input type="text" id="theresult" hidden="true"/>
</form>
现在当用户关闭 Fancybox 时,我需要捕获这个值供父页面使用,我已经尝试过:
$('.fancybox1').fancybox({
width: 800,
height: 500,
beforeClose: function () {
var testResult = $("#fancybox-frame").contents().find('input#theresult');
$('#txtTestValue').attr('value', testResult );
}
});
但这会返回“[object Object]”...
我做错了什么?!
【问题讨论】:
标签: javascript jquery fancybox fancybox-2