js如何创建和关闭窗口

 时间:2024-10-12 16:28:05

1、window.open()方法对应于创建浏览器窗口第一参数是url是其实讲白了就是网址第二参数是一个名字你可以自己命名第三 窗口的属性例如宽度和高度

2、window.close()则是关闭窗口的方法

3、下面代码你可以用一下试试:<!DOCTYPE html><html><head> <meta http-equiv="ContentType" content="text/html;charset=utf-8"> </head><body><!--<input type="button" value="button"/>--><h1>Create a new Window</h1><hr><p>Use the buttons below to test opening</p><hr><form name="winform"><input type="button" value="Open New Window"onClick="NewWin=window.open('','NewWin','toolbar=no,status=no,width=200,height=100');"/><!--这个按钮是创建一个窗口--><p><input type="button" value="Close New Window"onClick="NewWin.close();"/><!--这个按钮创建的·一个窗口被关闭--></p><p><input type="button" value="Close New Window"onClick="window.close();"/><!--这个按钮创建的·一个窗口被关闭--></p></form><br><p>have Fun</p></body></html>

4、在这里url你可以输入百度网址试试

  • PHP教程 if语句的使用
  • eclipse怎么关联SDK
  • IntelliJ IDEA如何设置快捷键及快捷键风格
  • java基础6.2.1 二维数组的创建及使用
  • Linux Ubuntu:[1]系统怎么设置成中文语言
  • 热门搜索
    旅游注意事项需知 旅游实习报告 旅游项目可行性研究报告 马尔代夫旅游图片 合肥市旅游局 3月份去哪旅游好 南京免费旅游景点大全 去英国旅游要多少钱 临潼旅游 贵州省旅游学校