js打开、关闭页面和运行代码那些事
<!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打开、关闭页面和运行代码那些事的更多相关文章
- js打开新页面 关闭当前页 关闭父页面
js打开新页面.关闭当前页.关闭父页面 2010-04-29 14:04:13| 分类: 页面与JavaScript | 标签: |字号大中小 订阅 //关闭当前页面,并且打开新页面,(不 ...
- js打开新页面与关闭当前页面
打开新的窗口window.open("help.html"); window.open("help.html"); 关闭页面<a href="j ...
- js 打开新页面 window.open()
利用js打开一个新页面,而不是一个新窗口. 在网上各种东西啊,蛋疼了半天,还白疼了.. 后来看到a标签有target属性,然后又发现window.open()的第二个参数是target,然后我笑了(e ...
- js在关闭页面前弹出确认提示【转载】
最近项目中出现个bug,就是导出数据后,会提示确认导航,其实实际需求并不需要这个提示,可能是之前遗留的问题.查了下资料是在触发了onbeforeunload事件,那么剩下的就是代码组织问题了. 众所周 ...
- js实现网页中的"运行代码"功能
<!DOCTYPE html> <html> <head> <meta charset='utf8' /> <title>网页中的运行代码功 ...
- JS打开新页面跳转
有时候使用js进行页面跳转,想使用 a 标签中 target="_blank" 形式,跳转打开一个新的页面. 可以使用以下脚本,创建一个 a标签,然后模拟点击操作. 代码如下: ...
- PHP JS HTML ASP页面跳转代码 延时跳转代码 返回到上一界面并刷新 JS弹出指定大小的新窗口
1.PHP延时跳转代码 //跳转到浏览界面 header("Refresh:1;url=machine_list.php"); //不延时 <?php header(&quo ...
- js打开新页面的方式:
1.超链接<a href="http://www.jb51.net" title="脚本之家">Welcome</a>等效于js代码wi ...
- PHP JS HTML ASP页面跳转代码 延时跳转代码
1.PHP延时跳转代码 //跳转到浏览界面 header("Refresh:1;url=machine_list.php"); //不延时 <?php header(&quo ...
随机推荐
- Vue 父组件循环使用refs调用子组件方法出现undefined的问题
Vue 父组件循环使用refs调用子组件方法出现undefined的问题 1. 背景 最近前端项目遇到一个问题,我在父组件中使用了两个相同的子组件child,分别设置ref为add和update.其中 ...
- CF620E New Year Tree 线段树 dfs序
luogu链接 题目大意: 有一个节点有颜色的树 操作1.修改子树的颜色 操作2.查询子树颜色的种类 注意,颜色种类小于60种 只有子树的操作,dfs序当然是最好的选择 dfs序列是什么,懒得讲了,自 ...
- SpringBoot添加自定义消息转换器
首先我们需要明白一个概念:springboot中很多配置都是使用了条件注解进行判断一个配置或者引入的类是否在容器中存在,如果存在会如何,如果不存在会如何. 也就是说,有些配置会在springboot中 ...
- JavaScript 时间格式
方法1: Date.prototype.Format = function (fmt) { var o = { , //月份 "d+": this.getDate(), //日 = ...
- JavaScript 装饰者模式(this运用)
例: function ConcreteClass() { this.performTask = function () { this.preTask(); console.log('doing so ...
- 51nod 1086 背包问题 V2
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1086 思路 裸的多重背包 巩固一下刚学的骚操作 #include< ...
- 01_Flume基本架构及原理
Flume消息收集系统,在整个系统架构中的位置 Flume概况1) Apache软件基金会的顶级项目2)存在两个大的版本:Flume 0.9.x(Flume-OG,original generatio ...
- Python的替换函数——replace(),strip(),和re.sub()
在Python中常用的三个"替换"函数是strip(),replace()和re.sub(),下面来讲讲这三个函数的用法. 一.replace() 基本用法:对象.replace( ...
- 学习mybatis-3 step by step 篇二
Mapper XML 文件 基本的*Mapper.xml文件配置就不熬述了具体可参考: http://www.mybatis.org/mybatis-3/zh/sqlmap-xml.html 1.sq ...
- Codeforces Beta Round #95 (Div. 2) C. The World is a Theatre 组合数学
C. The World is a Theatre There are n boys and m girls attending a theatre club. To set a play " ...