有人说写了代码没有效果。请仔细检查,注意几点:
1.取值是否加了"引号";
2.代码结束有没有在结尾加上";"分号!
切记!
(还有没想到的请补充)
1.取值是否加了"引号";
2.代码结束有没有在结尾加上";"分号!
切记!
(还有没想到的请补充)
2016-06-26
function openWindow(){
var ss1=confirm("确定打开新窗口");
var hq
if(ss1==true){
hq=prompt("请输入网址,'http://www.imooc.com/');
window.open('hq','width=400,height=500,menubar=no,toolbar=no');
}
else{
}
}
var ss1=confirm("确定打开新窗口");
var hq
if(ss1==true){
hq=prompt("请输入网址,'http://www.imooc.com/');
window.open('hq','width=400,height=500,menubar=no,toolbar=no');
}
else{
}
}
function contxt();
{alert("我调用了函数");}
<input type="button"value="点击我"onclick="contet()"/>
{alert("我调用了函数");}
<input type="button"value="点击我"onclick="contet()"/>
2016-06-26
function openWindow(){
var ss1=confirm("确定打开新窗口");
if(ss1==true){
window.open('http://www.imooc.com/');
}
else{
}
}
var ss1=confirm("确定打开新窗口");
if(ss1==true){
window.open('http://www.imooc.com/');
}
else{
}
}
这是教程给出的答案
function dclear(){
if(confirm("确定要取消设置吗?")){
var mychar = document.getElementById("txt");
mychar.style.color="#000";
mychar.style.backgroundColor="#fff";
mychar.style.width="600px";
mychar.style.height="400px";
mychar.style.display="block";
}
function dclear(){
if(confirm("确定要取消设置吗?")){
var mychar = document.getElementById("txt");
mychar.style.color="#000";
mychar.style.backgroundColor="#fff";
mychar.style.width="600px";
mychar.style.height="400px";
mychar.style.display="block";
}
javascript作为一种脚本语言可以放在html页面中任何位置,但是浏览器解释html时是按先后顺序的,所以前面的script就先被执行。
2016-06-26
已采纳回答 / 小和尚下山去化斋丶
_blank和_seft肯定有区别啊,一个是打开新的窗口,另一个是在原来的页面上打开;这个就类似于css中盒子里浏览器顶部和左端的意思差不多,marign-top,marign-left;是不是默认那要看你打开的页面的宽度高度是不是大于你设置打开窗口的宽度高度了,大于的话就会默认出现滚动条。
2016-06-26