看板 Web_Design 關於我們 聯絡資訊
請問一下 目前工作上有個需求 是當使用者離開網頁(或關閉網頁) 跳出新開一個問卷調查的網頁 但當使用者按button超連結離開 就不要跳出網頁 請問該用什麼方式來控制 謝謝 附上目前寫的內容 ================================================================== <html> <head> <title></title> </head> <script> function close_page() { window.open('http://www.google.com' , 'new_window'); //離開或關閉就開新網頁 } </script> <body onbeforeunload ="close_page()"> <button onclick="location.href='http://www.yahoo.com'">按此離開不跳出網頁 </button> </body> </html> -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.165.159.12 ※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1493982750.A.D85.html