我的代碼躲在哪里呢?
<!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 c= confirm("真的要打開新窗口嗎?");
? ? ? ? if(c==true){
? ? ? ? ? ? var p= promte("請輸入要打開的網(wǎng)站","http://idcbgp.cn");
? ? ? ? ? ? if(p!=null){
? ? ? ? ? ? ? ? window.open(p,'_blank','width=400','height=500','menubar=no','toolbar=no');//引號加上了,但是這個判斷出不來
? ? ? ? ? ? }
? ? ? ? ? ? else{
? ? ? ? ? ? alert("你都沒有輸入網(wǎng)址人家怎么打開嘛!");
????????????}//這里加完之后還是打不開
? ? ? ? }
? ? ? ? else{
? ? ? ? ? ? alert("不打開拉倒!再見啦");
? ? ? ? }
? ? ? ??
? ? }
? ??
? ? openWindow();
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2015-10-31
少了個}
2015-10-31
var p= promte("請輸入要打開的網(wǎng)站","http://idcbgp.cn");
不是promte 是prompt。。。。。。我不幫你看了,這些小毛病應(yīng)該自己發(fā)現(xiàn)自己解決的,不要一碰到問題就找別人幫忙,這樣才能進步。
2015-10-31
window.open(p,'_blank','width=400,height=500,menubar=no,toolbar=no);
這一句你最后面少了個''''''''''''''''''''''''''''
2015-10-31
?alert("你都沒有輸入網(wǎng)址人家怎么打開嘛!");
? ? ? ? }}
加多個}