2
再次使用colorbox與iframe,我試圖將信息從colorbox傳回父窗口。所有我試圖做的是在顏色框關閉後更新帶有通過顏色框傳遞的新文本的div。jquery,試圖從colorbox更新div到父
JQuery(window.parent.document).find("#textdiv").html("Some updated text");
parent.jQuery.fn.colorbox.close();
或者
$(window.parent.document).find("#textdiv").html("Some updated text");
parent.jQuery.fn.colorbox.close();
或者
parent.JQuery("#textdiv").html("Some updated text");
parent.jQuery.fn.colorbox.close();
或者
parent.$("#textdiv").html("Some updated text");
parent.jQuery.fn.colorbox.close();
然後在父窗口我:我在顏色框彈出試過這種
<div id="textdiv"></div>
jQuery(".purchasepop").colorbox({width:"80%", height:"80%", iframe:true,
onClosed:function(){ alert($("#textdiv").html());return false; }});
但是無論我嘗試什麼,警告框都是空白的。有什麼建議麼?