2009-10-12 59 views
1

很抱歉再次提出同样的问题,只是没人知道,我真的很需要这个答案。给iframe的父母打电话的功能

大家好,有人请告诉我如何激活一个功能,一旦Thickbox关闭,这将非常感激。

function tb_remove() { 
    window.parent.pageUpdate();// << this is what i have tried 
    $("#TB_imageOff").unbind("click"); 
    $("#TB_closeWindowButton").unbind("click"); 
    $("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();}); 
    $("#TB_load").remove(); 
    if (typeof document.body.style.maxHeight == "undefined") {//if IE 6 
     $("body","html").css({height: "auto", width: "auto"}); 
     $("html").css("overflow",""); 
    } 
    document.onkeydown = ""; 
    document.onkeyup = ""; 
    return false; 
} 

Firefox是说:

Error: window.parent.pageUpdate is not a function 
Source File: https://web111.secure-secure.co.uk/snowyswebsolutions.co.uk/scripts/js/thickbox.js 
Line: 270 

回答

0

这应该工作,提供父窗口有一个 “pageUpdate” 的方法。

但是,由于跨域javascript限制,如果iframe实际上正在加载另一个域,则无法执行此操作。

如果情况并非如此,请参阅您是否可以提供更多信息(网址?),然后查看是否可以发现其他任何信息。

0
url: 'https://web111.secure-secure.co.uk/snowyswebsolutions.co.uk/pageIncludes/' + page + '.php', 

使用https也许这将是一个问题呢?并且函数pageUpdate()是否必须加载到iframe中,或者只是在父级中加载?非常感谢你的回应。