DOM对象

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>open method test</title>
<script>
    var newWindow;
	function openNewWindow(){
	    var str=document.getElementById("newWindow").value;
		//alert(str);
		//window.prompt("hello");
		//window.resizeTo(300,300);
		//window.moveTo(50,50);
	    newWindow=window.open("http://www.qxndev.com","qxndev.com","width=300,height=300,location=no");

	}
	
	function closeNewWindow(){
	    newWindow.close();
	}
	function getNavigate(){
	   var nav=window.navigator;
	   for(var str in nav){
	        alert(str+"<<<<<"+nav[str]);
	   }
	}

 

</script> </head> <body> <button id="newWindow" value="open a new window" onclick="openNewWindow()">new window</button> <button id="closeWindow" value="close a new window" onclick="closeNewWindow()">close window</button> </body> </html>

 

open method test

posted on 2012-09-14 16:23  含风一笑  阅读(150)  评论(0)    收藏  举报