您可以 1) 引用您的窗口和 2) 在使用window.open()
.
var windowObjectReference = window.open(strUrl, strWindowName[, strWindowFeatures]);
您可以通过选择相同的窗口名称(第二个参数)来修改您的窗口。
var myWindow = window.open("http://google.com","myWindow");
// opens SO in the same window
window.open("http://stackoverflow.com","myWindow");
// the following will only work if it's the same domain, else subject to SOP -
// so in the case of initially opening it with google, this won't work!
myWindow.document.location.href = "/example/test.html";
// closes your window
myWindow.close();
因此,在您的情况下,以下行应该有效:
window.open('newURL','ItemArticle'/* optionally: ,'Parameters'*/);