大神們,求助我這段代碼沒有彈出 confirm ??
<!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 open=confirm("確認在新窗口打開網(wǎng)站嗎?");
?? ???? if(open==true)
?? ???? {
?? ??? ??? ?var url=prompt("請輸入網(wǎng)址","http://www.immoc.com");
?? ??? ??? ? if(url!=null)
?? ??? ??? ??? ? {
?? ??? ??? ??? ? ?? ?window.open(url,"_blank","width=400,height=500,menubar=no,toolbar=no");
?? ??? ??? ??? ? }
?? ??? ??? ? ?? ?else
?? ??? ??? ? ?? ?{
?? ??? ??? ? ?? ??? ?alert("再見!");
?? ??? ??? ? ?? ?}
??? ???? }
?? ???? else
?? ???? {
?? ??? ??? ?alert("再見!");
?? ???? }
}
?? ?</script>
</head>
<body>
?? ?<input type="button" value="打開新網(wǎng)址" onclick="openwindow()">
</body>
</html>
2016-01-17
prompt()函數(shù)中的逗號用成了中文逗號了,要用英文符號? ---->? ','? -----/----> ','