我有这个代码,在IE 9中不起作用。
var popup = window.open(url, 'categories','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();
};
使用弹出窗口中的回调函数和这样的调用正确运行onDone:
$("#done").click(function(){
if (window.onDone) window.onDone();
window.close();
return false;
});
但在IE 9中,此函数看起来像未定义。