Javascript 窗口变量的替换

Javascript 窗口变量的替换,javascript,popup,window,window.open,Javascript,Popup,Window,Window.open,在JavaScript代码中有一个 newlyCreatedWindow = window.open(url, stageName, strWindowFeatures); 即使禁用了弹出阻止,也会失败并返回NULL 是否可以将newlyCreatedWindow设置为当前窗口?为什么不可以?我猜你想做一个“撤退” (如果这不是您想要的,您应该指定您的问题)请编辑您的问题,并包括url、stageName和strWindowFeatures的值 if (!newlyCreatedWindow)

在JavaScript代码中有一个

newlyCreatedWindow = window.open(url, stageName, strWindowFeatures);
即使禁用了弹出阻止,也会失败并返回NULL


是否可以将newlyCreatedWindow设置为当前窗口?

为什么不可以?我猜你想做一个“撤退”


(如果这不是您想要的,您应该指定您的问题)

请编辑您的问题,并包括url、stageName和strWindowFeatures的值
if (!newlyCreatedWindow)
     newlyCreatedWindow = window;