已采纳回答 / Hyun0
看一下你的html代码里面提交那块有没有调用这个函数。还有,你那个window.open那里的第一个参数应该是addr, window.open(addr,'_blank','width=400,height=500,menubar=no,toolbar=no');
2016-07-19
网页由标签将信息组织起来,而标签的id属性值是唯一的,就像是每人有一个身份证号一样,只要通过身份证号就可以找到相对应的人。那么在网页中,我们通过id先找到标签,然后进行操作。
2016-07-19
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<h1>
<a href=""></a>
</h1>
<p></p>
<ul>
<li></li>
<li></li>
</ul>
</body>
</html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<h1>
<a href=""></a>
</h1>
<p></p>
<ul>
<li></li>
<li></li>
</ul>
</body>
</html>
function Wopen(){
var abc=prompt("输入网址")
if(abc!=null)
window.open(abc,'_blank','width=600,height=400,top=100,left=0')
}
var abc=prompt("输入网址")
if(abc!=null)
window.open(abc,'_blank','width=600,height=400,top=100,left=0')
}
2016-07-19
//定义"取消设置"的函数
function cancel(){
var mymessage = confirm("是否要取消设置?");
if(mymessage == true){
var all = document.getElementById("con");
var all2 = document.getElementById("txt");
all.removeAttribute("style");
all2.removeAttribute("style");
}
}
function cancel(){
var mymessage = confirm("是否要取消设置?");
if(mymessage == true){
var all = document.getElementById("con");
var all2 = document.getElementById("txt");
all.removeAttribute("style");
all2.removeAttribute("style");
}
}
最新回答 / 慕神8720576
我写的这个代码运行没有问题,<...code...>改为prompt的话,函数返回的是输入框中的字符串,没有输入的话返回的是null,判断的时候,不是判断是否为true。如果不用函数直接在脚本里写代码的话,如果放在body里的话是会直接运行的。需不需函数的话就要看要求了,不过用函数的话方便一点,如果需要多次调用的话还是用函数方便,可以多次使用,不需要多次重写。
2016-07-18
我真是。。。。。
为什么题目函数名要搞成openWWWWWWWWindow,为什么要大写WWWWWWWWWWWW????????
我搞了半小时,才发现是函数名没大写
卧槽。。。。。。。。。。。。。
为什么题目函数名要搞成openWWWWWWWWindow,为什么要大写WWWWWWWWWWWW????????
我搞了半小时,才发现是函数名没大写
卧槽。。。。。。。。。。。。。