function openWindow()
{
if(confirm("確定打開新窗口嗎?"))
{var openwindow=prompt("確定打開網址:"," http://www.xianlaiwan.cn/");
if(openwindow)
{window.open(' http://www.xianlaiwan.cn/','width=400px,height=500px,menubar=no,toolbar=no');
}
}
}
{
if(confirm("確定打開新窗口嗎?"))
{var openwindow=prompt("確定打開網址:"," http://www.xianlaiwan.cn/");
if(openwindow)
{window.open(' http://www.xianlaiwan.cn/','width=400px,height=500px,menubar=no,toolbar=no');
}
}
}
看了評論才知道document.getElementById('');和document.getElementById)("").InnerHTML;不一樣。。。。
2016-05-20
function openWindow(){
var answer=confirm("是否打開?");
if(answer==true){
prompt("確定你要打開的網址","http://www.xianlaiwan.cn");
window.open("width=400px,height=500px","menubar=no","toolbar=no");
}
else{
alert("那就結束");
}
}
var answer=confirm("是否打開?");
if(answer==true){
prompt("確定你要打開的網址","http://www.xianlaiwan.cn");
window.open("width=400px,height=500px","menubar=no","toolbar=no");
}
else{
alert("那就結束");
}
}
function openWindow(){
var yn=confirm("是否打開慕課網");
if(yn==true){
window.open('http://www.xianlaiwan.cn/','_blank','width=400','height=500','merubar=no','toolbar=no');
}
else
{
alert("那你點個毛!")
}
}
var yn=confirm("是否打開慕課網");
if(yn==true){
window.open('http://www.xianlaiwan.cn/','_blank','width=400','height=500','merubar=no','toolbar=no');
}
else
{
alert("那你點個毛!")
}
}
每一個語句都不一定是這個代碼串的結尾,很可能在之后我們需要在其后面增加別的語句,在每個語句結尾加分號,可以盡量避免在之后對代碼的改動中因為忘寫分號而產生的bug。
2016-05-20
function hidetext()
{
var mychar = document.getElementById("con");
mychar.style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display="block";
}
{
var mychar = document.getElementById("con");
mychar.style.display="none";
}
function showtext()
{
var mychar = document.getElementById("con");
mychar.style.display="block";
}
2016-05-20