点击HyperLink,我调用以下功能
window.open("<%=forHyperLink%>",'name','height=600,width=800');
Run Code Online (Sandbox Code Playgroud)
问题是,使用上面的行,只有一次Hyper Link点击工作(即如果点击了另一个超级链接,则没有打开窗口)
但是,如果我删除window.open的参数,只需使用
window.open("<%=forHyperLink%>");
Run Code Online (Sandbox Code Playgroud)
然后单击每个超链接,将打开一个新窗口.
请adivce.
更改name每个链接的每个窗口,以便在初始单击时打开的窗口不会被重复使用.
我猜测点击其他链接会打开初始/当前打开的弹出窗口上的链接,并导致混淆,即它不会打开新窗口.
// first window to open
window.open("first.html",'name','height=600,width=800');
// opens in the same window where first.html is opened because
// it targets the same window called `name`
window.open("second.html",'name','height=600,width=800');
// this works because by default it will open a new one everytime it is executed
window.open("new.html");
// opens a window with unique name
window.open("<%=forHyperLink%>",'name_' + Math.random(),'height=600,width=800');
Run Code Online (Sandbox Code Playgroud)