views:

310

answers:

2

Im sorry to ask the same question again its just nobody seems to know and i really really need the answer.

Hello all, could someone PLEASE advise me on how I can activate a function once Thickbox is closed, this would be much appreciated.

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 is saying :

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
A: 

That should work, providing the parent window has a "pageUpdate" method.

However, because of cross domain javascript limitations, you cannot do this if the iframe is actually loading another domain.

If this isn't the case, see if you can provide some more info (URLs?) and I'll see if I can spot anything else throwing it off.

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

using https maybe that would be a problem then? and does the function pageUpdate() have to be loaded into the iframe as well or just in the parent? Thank you very much for the response.

Phil Jackson