您的位置:首页 > Web前端 > JavaScript

JavaScript练习题目(4)弹出新窗口,并点击其上的按钮可以进行(50px,50px)的位移

2011-11-17 23:58 267 查看
<html>
	<head>
		<title>Web Title</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<script type="text/javascript" src="js/test.js"></script>
	</head>
	<body>
		<input type="button" value="Click" onclick="test();" />
	</body>
</html>


function test () {
	newWindow = window.open('', '', 'width=200, height=100');
	newWindow.document.write("<html><head></head><body>");
	newWindow.document.write("<input type='button' value='move' onclick='move();' />");
	newWindow.document.write("<script type='text/javascript' src='js/test.js'></script>");
	newWindow.document.write("</body></html>");
}
function move () {
	self.moveBy(50, 50);
	self.focus();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: