代碼哪里有錯誤?
<!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://idcbgp.cn','new_','weight=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? }
? ? ? else
? ? ? {
? ? ? ? ? return 0;
? ? ? }
? ? ??
? ? ? } ?// 新窗口打開時彈出確認(rèn)框,是否打開
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ??
2016-06-17
?function openWindow(){
? ? ? ?var windows="http://idcbgp.cn/"
? ? ? ?var openwin=prompt("請輸入你要打開的網(wǎng)址",windows)
? ? // 新窗口打開時彈出確認(rèn)框,是否打開
? ?if(openwin){
? ? // 通過輸入對話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
? ? ? ? var win=window.open(windows,"_blank","width=400, heigth=500 ,menubar=no,toolbar=no")
? ? ? ? //win.close()
? ? //打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ? }
? ?}
比對下?
2016-06-17
function openWindow(){
? ? if(confirm("確認(rèn)打開新窗口?")){
? ? ? ? var myname = prompt("請輸入你要代開的窗口的網(wǎng)址");
? ? ? ? if(myname != null){
? ? ? ? ? ? window.open("http://idcbgp.cn/","_blank","width=400,height=500");
? ? ? ? }else{
? ? ? ? ? ? alert(1);
? ? ? ? }
? ? }
? ? }
這個是我寫的代碼,在新打開的窗口那一塊兒,我沒有按照要求來寫,其他的都o(jì)k