哪位大佬看看這么寫對嗎
<!DOCTYPE html>
<html>
?<head>
? <title> new document </title>??
? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/>? ?
? <script type="text/javascript">??
? ? function NewWindow(){
? ? ? window.open('http://www.imocc.com/','_blank','width=400,height=500,menubar=no,toolbar=no');
? ?}
? ?function openWindow(){
? ? var mywindow=confirm("是否打開新窗口");
? ? if (mywindow==true){
? ? ? ? NewWindow();
? ? }
? ? else{
? ? ? ? None;
? ? }? ?
? ?}
? ??
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
2019-03-12
2019-03-12
open的url不對?。。?!慕課網(wǎng)的url是“http://idcbgp.cn”,采用的協(xié)議是HTTPS不是HTTP啊,所以你是打開不了“http://idcbgp.cn”的?。?!
2019-03-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 mywin=prompt("是否打開新窗口?");
? ? ? ? ? ? if(mywin=='確定'){
? ? ? ? ? ? ? ? var winmy=window.open('http://idcbgp.cn','width=400,height=500,menubar=no,toolbar=no');
? ? ? ? ? ? }
? ? ? ? ? ? else{
? ? ? ? ? ? }
? ? }
? </script>?
?</head>?
?<body>?
? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />?
?</body>
</html>
我是這么寫的~.~