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

来源:互联网 发布:linux共享内存 编辑:程序博客网 时间:2024/06/18 06:25
<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();}


原创粉丝点击