這個題答完了,這樣對嗎
?var myopen=confirm('確認要打開網頁嗎?')
? ?if(myopen==true){
? ? ? ?window.open('http://idcbgp.cn/','width:400,height=500,menubar=no,toolbar=no')
? ?}else{
? ? ? ?myopen.close();
? ?}
?var myopen=confirm('確認要打開網頁嗎?')
? ?if(myopen==true){
? ? ? ?window.open('http://idcbgp.cn/','width:400,height=500,menubar=no,toolbar=no')
? ?}else{
? ? ? ?myopen.close();
? ?}
2019-04-11
舉報
2019-04-24
2019-04-24
2019-04-18
難道你們都沒有看到默認打開網頁嗎?也就是說需要,輸入網頁的步驟:prompt
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
var condition = confirm('是否打開新的網頁');
if(condition==true){
var address=prompt('請輸入網站:','http://idcbgp.cn/');
window.open('http://idcbgp.cn/');
}
</script>
</body>
</html>
這是按我理解寫的,但是彈出的新窗口含有前綴,,無法正確打開新的網頁
2019-04-15
<!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 mymessege=confirm("是否打開網站?")// 新窗口打開時彈出確認框,是否打開
? ? if(mymessege==true)// 通過輸入對話框,確定打開的網址,默認為 http://idcbgp.cn/
? ? {
? ? ? ? window.open('http://idcbgp.cn','_blank','width=400,height=500,menubar=no,toolbar=no')?
? ? }//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
? ??
? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網站" onclick="openWindow()" />?
?</body>
</html>
2019-04-12
有和沒有效果是一樣的
2019-04-11
myopen.close()? ?不對吧? 不用寫else