所以我有一个父窗口,它打开一个新窗口(只是为了删除状态栏、工具栏等)。关闭父窗口后,传入的变量返回空白字符串。有时它会返回此错误消息:“远程服务器计算机不存在或不可用。” 即使在关闭父窗口后,我也确实需要访问此变量。有什么建议么?
var _env = {};
$(window).load(function()
{
/**
*
* If initialization was not yet performed, start the initialization.
* Otherwise, show application.
*
**/
if (window.opener)
{
/* Start transition to the new window */
window.blur();
_env = window.opener._env;
console.log(_env["title"]);
/* Show system */
window.opener.close();
window.focus();
console.log(_env["title"]); // Returns blank
}
else
{
/* Some process manipulating the '_env' variable */
/* .... */
/* .... */
window.open("./index.html", _env["title"], "directories=0, menubar=0, toolbar=0, titlebar=0, resizable=1, width=" + _env["winWidth"] + ", height=" + _env["winHeight"]);
window.focus();
window.open("","_self", ""); // To prevent prompt on closing..
}
});