大神們幫忙看下問題出在哪了,primept不運行
<!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 mywin=confirm("是否打開一個新窗口")
? ? ? if (mywin==ture){
? ? ? var web=prompt("請輸入你要打開的網址","http://www.xianlaiwan.cn")
? ? ? if web==null{
? ? ? ? ? web.open("_blank","width:400px","heigh:500px","menubar=no","toolbar=no"
? ? ? }
? ? ? }
? }
? ??
? ??
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2016-01-26
if語句有問題,打開窗口的命令window.open();
2016-01-26
正確代碼如下: <!DOCTYPE?html> <html> ????<head> ????????<title>?new?document?</title>?? ????????<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"/>? ????????<script?type="text/javascript"> ????????function?openWindow(){ ????????????var?mywin?=?confirm("是否打開一個新窗口"); ????????????if?(mywin==true){ ????????????????var?web=prompt("請輸入你要打開的網址","http://www.xianlaiwan.cn"); ????????????????if?(web?!=?null){ ????????????????????window.open(web,"_blank","width=400px,heigh=500,menubar=no,toolbar=no"); ????????????????} ????????????} ????????} ????????</script>? ????</head>? ????<body>? ????????<input?type="button"?value="新窗口打開網站"?onclick="openWindow()"?/>? ????</body> </html>2016-01-26
if(web!=null){
}
2016-01-26
if web==null{? // 是不是應該改成
if web!=null{