<script type="text/javascript">
function Wopen(){
window.open('http://www.baidu.com','_blank','width=600,height=400,top=100,left=100') ;
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="点击我,打开新窗口!" / >
</body>
</html>
function Wopen(){
window.open('http://www.baidu.com','_blank','width=600,height=400,top=100,left=100') ;
}
</script>
</head>
<body>
<input name="button" type="button" onClick="Wopen()" value="点击我,打开新窗口!" / >
</body>
</html>
2016-01-06
var message = confirm("是否打开");
if(message==false)
{
return ;
}
var webadd = prompt("你要打开的网站为","http://www.imooc.com/");
if(webadd == "http://www.imooc.com/")
{
window.open('http://www.imooc.com/','_blank','width=400px','height=500px','menubar=no','toolbar=on');
}
}
if(message==false)
{
return ;
}
var webadd = prompt("你要打开的网站为","http://www.imooc.com/");
if(webadd == "http://www.imooc.com/")
{
window.open('http://www.imooc.com/','_blank','width=400px','height=500px','menubar=no','toolbar=on');
}
}
confirm 消息对话框通常用于允许用户做选择的动作,如:“你对吗?”等。弹出对话框(包括一个确定按钮和一个取消按钮)。
语法:
confirm(str);
参数说明:
str:在消息对话框中要显示的文本
返回值: Boolean值
返回值:
当用户点击"确定"按钮时,返回true
当用户点击"取消"按钮时,返回false
语法:
confirm(str);
参数说明:
str:在消息对话框中要显示的文本
返回值: Boolean值
返回值:
当用户点击"确定"按钮时,返回true
当用户点击"取消"按钮时,返回false
2016-01-06
已采纳回答 / ppo_YXWU
问题有点多。看下我改的代码,对照下:<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><title> new document </title> <script type="text/javascript"> function openwindow(){//函...
2016-01-06
<script type="text/javascript">
function openWindow(){
var mymessage=confirm(".imooc.com/");
if(mymessage == true){
window.open('http://www.imooc.com','_blank','width=300,height=200,menubar=no,toolbar=no,status=no');
}else
{
}
}
</script> 为啥运行不正常
function openWindow(){
var mymessage=confirm(".imooc.com/");
if(mymessage == true){
window.open('http://www.imooc.com','_blank','width=300,height=200,menubar=no,toolbar=no,status=no');
}else
{
}
}
</script> 为啥运行不正常
已采纳回答 / finyxin
<p id="p1" > JavaScript使网页显示动态效果并实现与用户交互功能。</p> <input type="button" value="添加样式" onclick="add()"/>function add(){ var p1 = document.getElementById("p1"); p1.className="one"; }input中的onclick事件调用的函数add()只修改document.getEleme...
2016-01-06