js打开、关闭页面和运行代码那些事
生活随笔
收集整理的這篇文章主要介紹了
js打开、关闭页面和运行代码那些事
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
<!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="打開" οnclick="window.open('http://www.baidu.com'), '_self'" /><input type="button" value="關(guān)閉" οnclick="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="80" rows="10" id="text"></textarea><input type="button" value="運行" id="btn" />
</body>
</html>
轉(zhuǎn)載于:https://www.cnblogs.com/heboliufengjie/p/4162831.html
總結(jié)
以上是生活随笔為你收集整理的js打开、关闭页面和运行代码那些事的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 俄罗斯方块c语言教程codeblocks
- 下一篇: 【APIO2015】完跪记