windows.open("地址","wroxwindow","height=150,width=300,top=10,left=10,resizable=yes") 第三個(gè)參數(shù)定義新窗口屬性。
var newWin=window.open()
newWin.moveTo()
3、系統(tǒng)對(duì)話框
1.alert()用與輸入數(shù)據(jù)無(wú)效時(shí)
2.confirm() 顯示 OK Cancel按鈕
if(confirm("Are you sure?")){
alert("sure");
}else{
alert("not sure");
}
3.prompt()顯示給用戶輸入的對(duì)話框
var Result= prompt("What's your name ?","Michael";)
if(result!=null){}
4、狀態(tài)欄。
window.defaultStatus="dddd";
當(dāng)鼠標(biāo)移動(dòng)到某個(gè)連接上時(shí)顯示該連接的信息:
<a href="xx.html" onmouseover="window.status='information on wros books.' ">book</a>
5、時(shí)間間隔和暫停window對(duì)象的setTimeout方法
setTimeout(執(zhí)行的代碼, 暫停的毫秒數(shù))
var time= serTimeout(function(){alert();},1000);
clearTimeout(time);
setInterval("代碼",1000)代碼每次執(zhí)行之間等待的毫秒數(shù)
6、歷史 go()前進(jìn)或后退的頁(yè)面數(shù)
window.history.go(-1) 后退一頁(yè)
<a href="javascript:history.go(-1)">back</a>
history.back(); history.forward()可以實(shí)現(xiàn)同樣的操作。
7、location
location.href="網(wǎng)址";
location.reload(true);從服務(wù)器端重載當(dāng)前頁(yè)面
location.reload(false);或者location.reload();從緩存重載當(dāng)前頁(yè)面
location.toString()返回location.href的值。
8、screen對(duì)象
screen.availHeight 窗口可以使用的屏幕的高度像素
screen.availWidth 窗口可以使用的屏幕的寬度像素
heigth、with屏幕的高度、寬度
名稱: ?4C.ESL | .↗Evon
口號(hào): 遇到新問題?先要尋找一個(gè)方案乄而不是創(chuàng)造一個(gè)方案こ
mail: 聯(lián)系我