單行注釋,在注釋內容前加符號 “//”。
多行注釋以"/*"開始,以"*/"結束。
多行注釋以"/*"開始,以"*/"結束。
2016-04-06
<script type="text/script"> </script>要寫在<head></head>標簽里面
2016-04-06
function openWindow(){
var a;
a=prompt("是否打開網站:","http://www.xianlaiwan.cn/");
if (a=="http://www.xianlaiwan.cn/"){
window.open('http://www.xianlaiwan.cn/','_blank','width=400px,height=500px,menubar=no,toolbar=no')
}
else{
return null;
}
var a;
a=prompt("是否打開網站:","http://www.xianlaiwan.cn/");
if (a=="http://www.xianlaiwan.cn/"){
window.open('http://www.xianlaiwan.cn/','_blank','width=400px,height=500px,menubar=no,toolbar=no')
}
else{
return null;
}
<script>
var txt = document.getElementById("txt"); //定義全局變量
function color_change(){}
function size_change(){}
function context_on(){}
function context_off(){}
function cancel_set(){
var set = confirm("是否取消設置");
if(set)
txt.style="";
}
</script>
var txt = document.getElementById("txt"); //定義全局變量
function color_change(){}
function size_change(){}
function context_on(){}
function context_off(){}
function cancel_set(){
var set = confirm("是否取消設置");
if(set)
txt.style="";
}
</script>
function openWindow(){
// 新窗口打開時彈出確認框,是否打開
var winnew;winnew = confirm("是否打開窗口");
// 通過輸入對話框,確定打開的網址
if(winnew){
window.open("http://www.xianlaiwan.cn","","width=400,height=500,menubar=no,toolbar=no");
//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
}
else
return null;
}
// 新窗口打開時彈出確認框,是否打開
var winnew;winnew = confirm("是否打開窗口");
// 通過輸入對話框,確定打開的網址
if(winnew){
window.open("http://www.xianlaiwan.cn","","width=400,height=500,menubar=no,toolbar=no");
//打開的窗口要求,寬400像素,高500像素,無菜單欄、無工具欄。
}
else
return null;
}
window.open("http://www.xianlaiwan.cn","_blank","width=600,height=400,top=100,left=0");
2016-04-05