<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="智能社 - zhinengshe.com">
<meta name="copyright" content="智能社 - zhinengshe.com">
<title>智能社 - www.zhinengshe.com</title>
</head>
<body>
<input type="button" value="打开" onclick="window.open('http://www.baidu.com'), '_self'" />
<input type="button" value="关闭" onclick="window.close();" />
</body>
</html>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="智能社 - zhinengshe.com">
<meta name="copyright" content="智能社 - zhinengshe.com">
<title>智能社 - www.zhinengshe.com</title>
<style> </style>
<script>
window.onload=function (){
var oBtn=document.getElementById('btn');
var oText=document.getElementById('text');
oBtn.onclick=function (){
var oNewWidnow=window.open('about:blank', '_blank');
oNewWidnow.document.write(oText.value);
}; };
</script>
</head> <body>
<textarea cols="" rows="" id="text"></textarea>
<input type="button" value="运行" id="btn" />
</body>
</html>

js打开、关闭页面和运行代码那些事的更多相关文章

  1. js打开新页面 关闭当前页 关闭父页面

    js打开新页面.关闭当前页.关闭父页面 2010-04-29 14:04:13|  分类: 页面与JavaScript |  标签: |字号大中小 订阅     //关闭当前页面,并且打开新页面,(不 ...

  2. js打开新页面与关闭当前页面

    打开新的窗口window.open("help.html"); window.open("help.html"); 关闭页面<a href="j ...

  3. js 打开新页面 window.open()

    利用js打开一个新页面,而不是一个新窗口. 在网上各种东西啊,蛋疼了半天,还白疼了.. 后来看到a标签有target属性,然后又发现window.open()的第二个参数是target,然后我笑了(e ...

  4. js在关闭页面前弹出确认提示【转载】

    最近项目中出现个bug,就是导出数据后,会提示确认导航,其实实际需求并不需要这个提示,可能是之前遗留的问题.查了下资料是在触发了onbeforeunload事件,那么剩下的就是代码组织问题了. 众所周 ...

  5. js实现网页中的"运行代码"功能

    <!DOCTYPE html> <html> <head> <meta charset='utf8' /> <title>网页中的运行代码功 ...

  6. JS打开新页面跳转

      有时候使用js进行页面跳转,想使用 a 标签中 target="_blank" 形式,跳转打开一个新的页面. 可以使用以下脚本,创建一个 a标签,然后模拟点击操作. 代码如下: ...

  7. PHP JS HTML ASP页面跳转代码 延时跳转代码 返回到上一界面并刷新 JS弹出指定大小的新窗口

    1.PHP延时跳转代码 //跳转到浏览界面 header("Refresh:1;url=machine_list.php"); //不延时 <?php header(&quo ...

  8. js打开新页面的方式:

    1.超链接<a href="http://www.jb51.net" title="脚本之家">Welcome</a>等效于js代码wi ...

  9. PHP JS HTML ASP页面跳转代码 延时跳转代码

    1.PHP延时跳转代码 //跳转到浏览界面 header("Refresh:1;url=machine_list.php"); //不延时 <?php header(&quo ...

随机推荐

  1. VC++创建快捷方式、删除快捷方式、添加开始菜单程序组菜单并删除程序组菜单的实例

    转载:http://www.codefans.net/articles/1435.shtml 转载:http://www.cnblogs.com/morewindows/archive/2011/08 ...

  2. Python3基础 str split 用指定的字符将字符串分割

             Python : 3.7.0          OS : Ubuntu 18.04.1 LTS         IDE : PyCharm 2018.2.4       Conda ...

  3. 【域名配置】Tomcat外网发布域名配置

    1.修改端口 首先,访问服务器时默认的是80端口,tomcat中的server.xml文件直接修改,这里要说明的是如果一个服务器上有多个tomcat的话,修改端口需要注意的是要修改 <Serve ...

  4. [loss]Triphard loss优雅的写法

    之前一直自己手写各种triphard,triplet损失函数, 写的比较暴力,然后今天一个学长给我在github上看了一个别人的triphard的写法,一开始没看懂,用的pytorch函数没怎么见过, ...

  5. 【TCP/IP详解 卷一:协议】第四章 ARP:地址解析协议 以及其他部分的一些知识

    4.1 引言 数据链路 如以太网(Ethernet) 或者 令牌环网 都有自己的寻址机制(一般为 48 bit 的地址). 一个网络(数据链路层) 可以同时被多个不同的网络使用.比如,一组使用TCP/ ...

  6. hdu 5652 India and China Origins 并查集+二分

    India and China Origins Time Limit: 2000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/ ...

  7. python 集合元素添加

    #A new empty set color_set = set() color_set.add("Red") print(color_set) #Add multiple ite ...

  8. python 元组查找元素返回索引

    #create a tuple tuplex = tuple("index tuple") print(tuplex) #get index of the first item w ...

  9. spring boot打jar包发布

    artifactId 是即将打包的包的名称 version 是即将打包的版本号 packaging 是即将打包的格式,这里讲的是jar包 终端输入命令: mvn clean install 然后在ta ...

  10. 【转】VC6在Win7下打开文件崩溃问题

    http://www.cnblogs.com/Leon5/archive/2011/08/24/2152670.html 1.微软针对这个问题发布了一个补丁包.下载地址 2.下载之后是一个源码包,解压 ...