哪里出問題了呢,為什么加載網(wǎng)頁顯示404呢?還望好心人指點,謝謝
? ? function openWindow(){
? ? ? ? ?// 新窗口打開時彈出確認(rèn)框,是否打開
? ? ? ? var message=confirm("是否打開新網(wǎng)站?");
? ? ? ? if(message==true){
? ? ? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? ? ? ? ? var url=prompt("請輸入網(wǎng)址:");
? ? ? ? ? ? if(url!=null){
? ? ? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? ? ? ? ? ? ? window.open('url','_blank','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? }
? ? ? ? ? ? else{
? ? ? ? ? ? ? ?window.open('http://idcbgp.cn/','_blank','width=400,height=500,menubar=no,toolbar=no'); ? ? ? ? ? ? ? ?
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? else{
? ? ? ? ? ? return false;
? ? ? ? }
? ? }
2017-07-06
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript">?
? function openWindow()
? {
? ? var www=confirm("是否打開網(wǎng)址?");
? ? // 新窗口打開時彈出確認(rèn)框,是否打開
? ? if(www==true){
? ? ? ? window.open('http://idcbgp.cn','_blank','width=400px,height=500px');
? ? }
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? else{
? ? ? ? document.write("取消打開網(wǎng)址");
? ? }
? } ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2017-07-04
window.open('url') ?不能帶引號 寫成window.open(url) ?
2017-07-02
window.open('url','_blank','width=400,height=500,menubar=no,toolbar=no'); ?// 'url'不應(yīng)該帶單引號。