代碼哪里有錯(cuò)誤?
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title> ?
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??
? <script type="text/javascript"> ?
? ??
? function rec(){
? ? ? var message= confirm();
? ? ?message =prompt()
? ? ? if(message==true)
? ? ? {
? ? ? ? ? window.open('http://yifanck.cn','new_','weight=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? }
? ? ? else
? ? ? {
? ? ? ? ? return 0;
? ? ? }
? ? ??
? ? ? } ?// 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://yifanck.cn/
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ??
? ??
2016-06-17
?function openWindow(){
? ? ? ?var windows="http://yifanck.cn/"
? ? ? ?var openwin=prompt("請(qǐng)輸入你要打開(kāi)的網(wǎng)址",windows)
? ? // 新窗口打開(kāi)時(shí)彈出確認(rèn)框,是否打開(kāi)
? ?if(openwin){
? ? // 通過(guò)輸入對(duì)話框,確定打開(kāi)的網(wǎng)址,默認(rèn)為 http://yifanck.cn/
? ? ? ? var win=window.open(windows,"_blank","width=400, heigth=500 ,menubar=no,toolbar=no")
? ? ? ? //win.close()
? ? //打開(kāi)的窗口要求,寬400像素,高500像素,無(wú)菜單欄、無(wú)工具欄。
? ? }
? ?}
比對(duì)下?
2016-06-17
function openWindow(){
? ? if(confirm("確認(rèn)打開(kāi)新窗口?")){
? ? ? ? var myname = prompt("請(qǐng)輸入你要代開(kāi)的窗口的網(wǎng)址");
? ? ? ? if(myname != null){
? ? ? ? ? ? window.open("http://yifanck.cn/","_blank","width=400,height=500");
? ? ? ? }else{
? ? ? ? ? ? alert(1);
? ? ? ? }
? ? }
? ? }
這個(gè)是我寫的代碼,在新打開(kāi)的窗口那一塊兒,我沒(méi)有按照要求來(lái)寫,其他的都o(jì)k