彈出窗口/自定義窗口javascript
彈出窗口分爲三種:警告框/確認框/提示框。警告框沒有返回值;確認框點擊確認按鈕返回true/點擊取消按鈕返回false;提示框點擊確認按鈕返回輸入框的值,取消或關閉提示框返回null。 css
window.onload=test; function test(){ var res=alert("nihao"); alert(res); /*var res=prompt("what's your name?","chen"); if(res==null){ alert("nihao"); }*/ /*var res=confirm("asdasdasd"); if(res==true){ alert("nihao"); } else{ alert("buhao"); }*/ }
自定義窗口:html
window.onload=test; function test(){ var newWindow=window.open("http://www.baidu.com","new window", "height=300,width=400,toobar=no,location=no"); }
frame對象的靈活使用java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html> <head> <title>夢之都框架頁示例</title> </head> <frameset rows="120, *, 80"> <frame src="index.html" /> <frame src="http://www.dreamdu.com/css/" /> <frame src="http://www.dreamdu.com/javascript/" /> <noframes> <body> 夢之都使用了框架技術,可是您的瀏覽器不支持框架, 請升級您的瀏覽器以便正常訪問夢之都。 </body> </noframes> </frameset> </html>