這樣OK不?
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">?
? function openWindow() {
? ? ? if (confirm("打開新窗口")) {
? ? ? ? ? if (var newpage=prompt("打開新窗口","http://idcbgp.cn/")){
? ? ? ? ? ? ? window.open(newpage,'_blank',"width=400px,height=500px,menubar=no,toolbar=no,scrollbars=no,status=no");
? ? ? ? ? }
? ? ? ? ? else{
? ? ? ? ? ? ? alert("你選擇了取消");
? ? ? ? ? }
? ? ? }
? ? ? else {
? ? ? ? ? alert("你選擇了取消");
? ? ? }
? }
? ?
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2018-12-16
ok吧
2018-12-12
function openWindow(){
? ? var newwindow=confirm("是否打開慕課網(wǎng)?")
? ? if(newwindow==true)
? ? {
? ? ? ? document.write('我點擊了確定');
? ? ? ? window.open('http://idcbgp.cn','_blank','width=500','menubar=no','toolbar=no');
? ? }
? ? else
? ? {
? ? ? ? document.write('我點擊了取消');
? ? }
? }
2018-12-12
function openWindow(){
? ? var newwindow=confirm("是否打開慕課網(wǎng)?")
? ? if(newwindow==true)
? ? {
? ? ? ? document.write('我點擊了確定');
? ? ? ? window.open('http://idcbgp.cn','width=400,height=500,menubar=no,toolbar=no');
? ? }
? ? else
? ? {
? ? ? ? document.write('我點擊了取消');
? ? }
? }
2018-12-12
<!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 xin=confirm("你確定要打開新窗口嗎?"); ?//首先設(shè)置變量,用confirm確認(rèn)信息框
if ( xin == true) { ?//if判斷,當(dāng)選擇確定,返回true的時候,下面用window.open打開頁面
window.open('http://www.tingchefm.com/','_blank','width=400,height=500,menubar=no,toolbar=no');
} else{
?//if判斷,當(dāng)選擇取消,返回false的時候,不進(jìn)行任何操作
}
? ? }
? </script>?
?</head>?
?<body>?
?<input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>