我正在尝试从fancybox 更新我网站上的元素。在fancybox中,我做了一个$.post()并取回html我想要填充到我页面上的div中的数据。我打开一个iframe窗口,html下面的脚本就在里面iframe。它无法从fancybox 中找到它,所以任何人都知道如何找到不在fancybox 内的元素的想法或解决方案iframe?
$('.add-to-cart').click(function () {
var $this = $(this).closest('form');
$.post($this.attr('action'), { quantity: $this.find('#quantity_id').val() }, function (data) {
parent.$.fancybox.close();
$('#container').html(data);
}, 'html');
return false;
});