在html中某按鈕的onclick事件綁定代碼如下:
window.open("http://localhost:8080/appdemo/account.html?" + new Date().getTime(), "賬戶資料")。
結果發現再次點擊該按鈕時沒能在兩個網頁中打開。
經過一翻折騰,終於發現原因,就是window.open函數的target參數得用不同的值或者_blank。
具體代碼如下:window.open("http://localhost:8080/appdemo/account.html?" + new Date().getTime(), "_blank")