//定義"隱藏內容"的函數
function hidemessage() {
var mymessage = document.getElementById("txt");
mymessage.style.display = "none";
}
//定義"顯示內容"的函數
function showmessage() {
var mymessage = document.getElementById("txt");
mymessage.style.display = "block";
}
function hidemessage() {
var mymessage = document.getElementById("txt");
mymessage.style.display = "none";
}
//定義"顯示內容"的函數
function showmessage() {
var mymessage = document.getElementById("txt");
mymessage.style.display = "block";
}
window.open('http://www.xianlaiwan.cn','_self','width:600px; height:400px; left:0px; top:100px';還是新開了一個新的窗口
2016-02-14
function Colse_YN()
{
var mywin=window.open("http://www.xianlaiwan.cn");
var Co_YN = prompt("確定關閉新開網頁嗎?","yes");
if(Co_YN =="yes")
{
mywin.close();
alert("已經關閉了新開網頁");
}
else
{
alert("未關閉網頁");
}
}
{
var mywin=window.open("http://www.xianlaiwan.cn");
var Co_YN = prompt("確定關閉新開網頁嗎?","yes");
if(Co_YN =="yes")
{
mywin.close();
alert("已經關閉了新開網頁");
}
else
{
alert("未關閉網頁");
}
}
2016-02-14
<script type="text/javascript">
var shuzi;
shuzi=8;
var shuziT;
shuziT = 2;
document.write(shuzi+shuziT)
</script>
var shuzi;
shuzi=8;
var shuziT;
shuziT = 2;
document.write(shuzi+shuziT)
</script>
2016-02-13
function Wopen(){
window.open('http://www.xianlaiwan.cn','_blank','width=300,height=100,top=100,left=100,scrollbars=yes,status=no,menubar=no,toolbar=no')
}
<input type="button" name=button value="點擊我" onClick="Wopen" />
window.open('http://www.xianlaiwan.cn','_blank','width=300,height=100,top=100,left=100,scrollbars=yes,status=no,menubar=no,toolbar=no')
}
<input type="button" name=button value="點擊我" onClick="Wopen" />
2016-02-13