目前,我写这样的代码 -
chatWindow = window.open("chatWindow.html", "Chat Window",
resizable=0,width=700,height=600);
var currentUserElement = chatWindow.document.createElement("currentUserElement");
currentUserElement.setAttribute("id", "currentUserElement");
currentUserElement.setAttribute("value",currentUserName);
但是,有没有一种方法可以在调用 window.open() 之前先执行 createElement() 部分?