你們第二章的編程練習都有彈窗嗎
<!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,my message=confirm;
????????if(mymessage="是否打開新網址?")
????????{
????????????alert document.write("是否打開新網址?"+mymessage)
????????????
????????}
????????else {
????????????alert window.open(' http://www.xianlaiwan.cn','_black','width400px','hight500px','menubar=no','toolbar=no')
????????}
????}
????// 新窗口打開時彈出確認框,是否打開
?
????// 通過輸入對話框,確定打開的網址,默認為 http://www.xianlaiwan.cn/
?
????//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
????
????
??</script>
?</head>
?<body>
??<input type="button" value="新窗口打開網站" onclick="openWindow()" />
?</body>
</html>
2019-05-15
哥們,你這里
? 這里的意思是,這個按鈕點擊下去,調用openWindow()這個,可是你js定義的是
function rec(){
}
所以沒有反應啊,而且
怎么可以這樣寫,賦值要兩個等于號
這樣就搞定了!多檢查,標點符號都打錯兄弟
這一句打錯了,var mymessage=confirm("這里寫的是彈窗信息");
多檢查就行了