[英]Alert Box: click ok then pop up a new broswer window to another website, How?
javascript,例如:
<script type="text/javascript">
if(!alert("msg here ")) document.location = 'http://google.com';
</script>
此腳本僅在相同的選項卡或窗口中轉到google,我要彈出一個窗口,然后轉到google.com。 謝謝。
不友好的方式:
<script type="text/javascript">
if(!alert("msg here")) window.open("http://google.com");
</script>
更友好的方式:
<script type="text/javascript">
if(confirm("Do you wish to go to google?")) window.open("http://google.com");
</script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.