已采纳回答 / 慕丝2791062
加一个判断条件即可,在你的代码基础上增减了一些东西:<!DOCTYPE html><html> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <script type="text/javascript"> function openWindow(...
2019-02-11
最新回答 / weixin_慕盖茨5207985
我试了一下,这个可行<!DOCTYPE html><html> <head> <title> new document </title> <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> <script type="text/javascript"> function openWindow(){var a=confirm(...
2019-02-11
已采纳回答 / 完美丶沉睡
window.open("_blank","width=400px,height=500px,menubar=no,toolbar=no");要改成 window.open(oppps, "_blank","width=400px,height=500px,menubar=no,toolbar=no");你没告诉函数该打开那个网址,默认第一个参数为网址。
2019-02-10
最新回答 / 慕粉1471436281
function openWindow() { var lz=confirm("打开网址吗?"); if(lz==true) { var lzz; lzz=prompt("网址",'http://www.imooc.com/'); window.open(lzz,'_blank','width=400px,height=500px,menubar=no,toolbar=no'); } }
2019-02-09
已采纳回答 / lesifh
下面有个click触发事件, 代表点击了按钮就执行括号里的函数,函数里包括了javascript语句,如果在<script type="text/javascript"></script>标签中写入了函数的执行,那么达不到通过按钮来控制的效果。
2019-02-09
自己写的,把js部分贴出来,希望能给需要的同学做个参考
...
function openWindow(){
var $confirm = confirm("您确定要打开吗?")
if($confirm == true){
var $prompt = prompt("请输入您想要打开的网址:","http://www.imooc.com/")
window.open($prompt,'_blank','width=400,height=500,menuus=no,toolbar=no')
}
}
...
...
function openWindow(){
var $confirm = confirm("您确定要打开吗?")
if($confirm == true){
var $prompt = prompt("请输入您想要打开的网址:","http://www.imooc.com/")
window.open($prompt,'_blank','width=400,height=500,menuus=no,toolbar=no')
}
}
...
最新回答 / qq_慕姐7305722
function changeColor(){ txt.style.color="yellow"; txt.style.background="blue";这写错了,应该是txt.style.backgroundColor}
2019-02-08
最新回答 / 慕桂英3007397
function openWindow(){ var queren=confirm("真的要打开,大人的世界吗"); if(queren==true) { var shuru=prompt("你真的已经满18岁了吗","http://www.imooc.com"); if(shuru!=null) { window.open(shuru,"_blank",'width=400px,height=500px,menubar=n...
2019-02-07