<!DOCTYPE?html>
<html>
?<head>
??<title>?new?document?</title>??
??<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>???
??<script?type="text/javascript">??
??function?Wopen()
??{
??var?mymessage=confirm("是否打開新窗口");
??if(mymessage==ture)
??{
??????var?url=prompt("請(qǐng)輸入網(wǎng)址","?http://idcbgp.cn/");
??????if(mymessage!=null)
??????{
??????windows.open(url,'_blank','width=400px,height=500px,menubar=no,toolbar=no');
??????}
??}
??else
??{
??????alert("再見!");
??}
??}
??</script>?
?</head>?
?<body>?
??<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="Wopen"?/>?
?</body>
</html>
2017-11-25
牛逼? 你的TRUE? TURE 寫反了,,改過來就好。。。。
2017-11-27
字符編碼=utf-8
ture改成true
prompt中的網(wǎng)址是英文的冒號(hào):
windows改為window
最后的onclick="wopen()"?
改玩再試試
2017-11-25
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">??
? function Wopen()
? {
? var mymessage=confirm("是否打開新窗口");
? if(mymessage==true)
? {
? ? ? var url=prompt("請(qǐng)輸入網(wǎng)址"," http://idcbgp.cn/");
? ? ? if(mymessage!=null)
? ? ? {
? ? ? windows.open(url,'_blank','width=400px,height=500px,menubar=no,toolbar=no');
? ? ? }
? }
? else
? {
? ? ? alert("再見!");
? }
? }
? </script>?
?</head>?
?<body>?
? ? ? <input type="button" value="新窗口打開網(wǎng)站" onclick="Wopen()" />?
?</body>
</html>
2017-11-25
最后一個(gè) onclick="Wopen()" ? ?你少了一個(gè) ?括號(hào)。。。。。 這是個(gè)不易察覺的錯(cuò)誤。。。
2017-11-25
<!DOCTYPE?html>
<html>
?<head>
??<title>?new?document?</title>??
??<meta?http-equiv="Content-Type"?content="text/html;?charset=gbk"/>???
??<script?type="text/javascript">??
??function?Wopen()
??{
??var?mymessage=confirm("是否打開新窗口");
??if(mymessage==ture)
??{
??????var?url=prompt("請(qǐng)輸入網(wǎng)址","?http://idcbgp.cn/");
??????if(mymessage!=null)
??????{
??????windows.open(url,'_blank','width=400px,height=500px,menubar=no,toolbar=no');
??????}
??}
??else
??{
??????alert("再見!");
??}
??}
??</script>?
?</head>?
?<body>?
??????<input?type="button"?value="新窗口打開網(wǎng)站"?onclick="Wopen()"?/>?
?</body>
</html>
2017-11-25
是不是瀏覽器問題?禁用了