JavaScriptBOM - open/sub和sup
<head>
<metacharset="utf-8">
<title></title>
<script type="text/javascript">
window.onload =function(){
var oBtn =document.getElementById("btn");
oBtn.onclick= function(){
window.open("http://www.baidu.com");
}
}
</script>
</head>
<body>
<input type="button" value="按钮"id="btn" />
</body>
<head>
<metacharset="utf-8">
<title></title>
<script type="text/javascript">
window.onload =function(){
var oBtn =document.getElementById("btn");
oBtn.onclick= function(){
window.open("http://www.baidu.com",”百度”);
}
}
</script>
</head>
<body>
<input type="button" value="按钮"id="btn" />
</body>
<script type="text/javascript">
window.onload =function(){
var oBtn =document.getElementById("btn");
oBtn.onclick= function(){
window.open("http://www.baidu.com","百度","width=400,height=400,top=200,left=200");
}
}
</script>
</head>
<body>
<input type="button" value="按钮"id="btn" />
</body>
<!DOCTYPEhtml>
<html>
<head>
<metacharset="utf-8">
<title></title>
<style>
body{background-color: blue;}
</style>
<script>
window.onload =function(){
var oBtn =document.getElementById("btn");
oBtn.onclick= function(){
open("sub.html","子窗口","width=400,height=400,top=200,left=200")
}
}
</script>
</head>
<body>
<inputtype="button" value="打开子窗口"id="btn" />
</body>
</html>
<!DOCTYPEhtml>
<html>
<head>
<metacharset="utf-8">
<title></title>
<style>
body{background-color:yellow;}
</style>
<script>
window.onload =function(){
var oBtn =document.getElementById("btn");
oBtn.onclick= function(){
//alert(opener);
opener.document.write("666666");
}
}
</script>
</head>
<body>
<inputtype="button" value="按钮"id="btn" />
</body>
</html>
赞 (0)