开发者

I have trouble calling callback function in popup window in IE9

I have this code, that doesn't work in IE 9.

var popup = window.open(url, 'catego开发者_JAVA百科ries','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=450,screenX=150,screenY=150,top=150,left=150');
popup.onDone = function(){
        var selected = popup.getSelectedIds();
    var allready = [];

    $("#tab-categories tr input:hidden").each(function(){
        if ($.inArray(this.value, selected) != -1) {
        allready[allready.length] = this.value;
        } else {
        $(this).parent().parent().remove();
        }
    });
    for (var i=0, len = selected.length; i<len; i++) {
        if ($.inArray(selected[i], allready) != -1) continue;
        addCategory(popup.getItemInfo(selected[i]));
    }

        updateCategoriesCounter();
        updateCategoriesMainFlag();
    };

Exactly function onDone using as callback function in popup and calls like this:

$("#done").click(function(){
    if (window.onDone) window.onDone();
    window.close();

    return false;
});

but in IE 9 this function looks like undefined.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜