有答案嗎?
1、新窗口打開時(shí)彈出確認(rèn)框,是否打開
提示: 使用 if 判斷確認(rèn)框是否點(diǎn)擊了確定,如點(diǎn)擊彈出輸入對(duì)話框,否則沒有任何操作。
2、通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
3、打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
1、新窗口打開時(shí)彈出確認(rèn)框,是否打開
提示: 使用 if 判斷確認(rèn)框是否點(diǎn)擊了確定,如點(diǎn)擊彈出輸入對(duì)話框,否則沒有任何操作。
2、通過輸入對(duì)話框,確定打開的網(wǎng)址,默認(rèn)為 http://idcbgp.cn/
3、打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
2016-09-21
舉報(bào)
2016-11-01
thanks
2016-09-21
不要看粘貼復(fù)制的帖子,函數(shù)是有順序的,一定要一步一步的去綁定事件,原理類似Div+css定位布局,先定主框,再定小框!這是我寫的代碼? 算是很詳細(xì)了,希望能幫到你!共同進(jìn)步!
注意?。。〈蜷_的網(wǎng)站大小可能會(huì)全屏,是瀏覽器的兼容問題!WIN10的Edge瀏覽器就不兼容!
<script type="text/javascript">
?function text(){
??var ceshi=confirm("確定打開新網(wǎng)站?")
??var xinwangzhan;
??if(ceshi==true){
???xinwangzhan=prompt("請(qǐng)輸入網(wǎng)站:","http://idcbgp.cn/")
???window.open(xinwangzhan,"_blank","width=400px,height=500px,menubar=no,toolbar=no")}
??}
</script>
<button onclick="text()">這是一個(gè)測(cè)試</button>
2016-09-21
<!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("是否打開?");
? ? if(open==true)
? ? {
? ? ? ? var op=prompt("輸入您的網(wǎng)址","idcbgp.cn");
? ? ? ? if(op!=null){
? ? ?? window.open(op,'_blank','width=400px,height=500px,menubar=no,toolbar=no'); }
? ? ?? else{
? ? ? ? ?? alert("88");
? ? ?? }
? ? }
? ? ? ? else
? ? ? ? {
? ? ? alert("88");
? ? ? }
? ? }?
? </script>
</head>
<body>
? ? ? ? ? <input type="button" value="新窗口打開網(wǎng)站" onclick="openWindow()" />
</body>
</html>
2016-09-21
function windowOpen(){
var isOpen=confirm("是否打開");
if(isOpen){
window.open(“http://idcbgp.cn”,"_blank","width=4000,height=500,menubar=no,toolbar=no");
}
}