誰來救救我?。。?/h1>
我試了N次了,提交代碼也說通過了,就是點擊“新窗口打開網址”不能打開,要崩潰了!親愛的老師你在哪?救救我?。。。。?!
<!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?url=prompt("請輸入網站","www.baidu.com");
if(url!=null)//?通過輸入對話框,確定打開的網址,默認為?http://idcbgp.cn/
{
????window.open(url,"_blank","height=500px,width=400px,top=0px,left=0px,menubar=no,toolbar=no,?status=no,scrollbars=no");
????}//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
???else
???{alert("再見");}??
????}
???else
???{alert("也是再見");}
???}
??</script>?
?</head>?
?<body>?
??????<input?type="button"?value="新窗口打開網站"?onclick="openWindow()"?/>?
?</body>
</html>
我試了N次了,提交代碼也說通過了,就是點擊“新窗口打開網址”不能打開,要崩潰了!親愛的老師你在哪?救救我?。。。。?! <!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?url=prompt("請輸入網站","www.baidu.com"); if(url!=null)//?通過輸入對話框,確定打開的網址,默認為?http://idcbgp.cn/ { ????window.open(url,"_blank","height=500px,width=400px,top=0px,left=0px,menubar=no,toolbar=no,?status=no,scrollbars=no"); ????}//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。 ???else ???{alert("再見");}?? ????} ???else ???{alert("也是再見");} ???} ??</script>? ?</head>? ?<body>? ??????<input?type="button"?value="新窗口打開網站"?onclick="openWindow()"?/>? ?</body> </html>
2015-06-19
在瀏覽器里找錯就能看到了
2015-06-19
<html>
<head>
<script type="text/javascript">
function disp_prompt()
{
var name=prompt("Please enter your name","")
if (name!=null && name!="")
{
document.write("Hello " + name + "!")
}
}
</script>
</head>
<body>
<input type="button" onclick="disp_prompt()"
value="Display a prompt box" />
</body>
</html>
2015-06-19
一、window.open()支持環(huán)境:
JavaScript1.0+/JScript1.0+/Nav2+/IE3+/Opera3+
二、基本語法:
window.open(pageURL,name,parameters)?
其中:
pageURL 為子窗口路徑?
name 為子窗口句柄?
parameters 為窗口參數(shù)(各參數(shù)用逗號分隔)?
三、示例:
<SCRIPT>?
<!--?
window.open ('page.html','newwindow','height=100,width=400,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no')?
//寫成一行?
-->?
</SCRIPT> ? ?