<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();
}