IE裡Window的Method列表

來源:互聯網
上載者:User
window

alert(sMsg)
//彈出一個確認訊息框
attachEvent(sEvent,pFunction)
//綁定一個函數到某個事件,事件觸發時隨機執行其中一個被綁定的函數
blur()
//令視窗喪失焦點

clearInterval(iIntervalID)
//清除指定定時器的關聯函數
clearTimeout(iTimeoutID)
//清除指定延時器的關聯函數
close()
//關閉視窗,如果視窗不是用指令碼開啟的,會彈出確認對話方塊。
confirm([sMessage])
//彈出“確定/取消”對話方塊
createPopup([vArgs])
//建立一個隱藏的彈出式視窗,vArgs是未來考慮提供的參數,返回視窗控制代碼
detachEvent(sEvent,pFunction)
//取消一個事件的某個綁定函數
execScript(sExpression, sLanguage)
//用指定的語言執行代碼
focus()
//啟用視窗

moveBy(iX,iY)
//用相對方式移動視窗
moveTo(iLeft,iTop)
//用絕對方式移動視窗
navigate(sURL)
//轉到指定的串連

open( [sURL] [, sName] [, sFeatures] [, bReplace])
//開啟新視窗,並返回視窗控制代碼
//sName=(*_blank:開啟一個新的未命名視窗;_parent:在父視窗中開啟;_search:同時開啟搜尋視窗;_self:替換本視窗; _top:在最上層視窗裡開啟;*)
//sFeatures=(*channelmode = { yes | no | 1 | 0 };directories = { yes | no | 1 | 0 };fullscreen = { yes | no | 1 | 0 };height = number;left = number;location = { yes | no | 1 | 0 };menubar = { yes | no | 1 | 0 };resizable = { yes | no | 1 | 0 };scrollbars = { yes | no | 1 | 0 };status = { yes | no | 1 | 0 };titlebar = { yes | no | 1 | 0 };toolbar = { yes | no | 1 | 0 };top = number;width = number;*)

print()
//列印當前視窗文檔內容
prompt( [sMessage] [, sDefaultValue])
//彈出輸入對話方塊
resizeBy(iX, iY)
//以相對方式改變視窗大小
resizeTo(iWidth, iHeight)
//以絕對方式改變視窗大小

scroll(iX,iY)
滾動視窗,與scrollTo一樣的效果,出於相容性的考慮保留下來的方法
scrollBy(iX, iY)
//用相對方式滾動視窗
scrollTo(iX, iY)
//用絕對方式滾動視窗
setActive()
//啟用目標而不將視線轉向目標
setInterval(vCode, iMilliSeconds [, sLanguage])
//定時執行一段代碼
setTimeout(vCode, iMilliSeconds, sLanguage)
//延時執行一段代碼
showHelp(sURL [, vContextID])
//開啟一個協助檔案,sURL為協助文檔地址,vContextID為協助索引號

showModalDialog(sURL [, vArguments] [, sFeatures])
//開啟一個強制回應對話方塊
//vArguments=需要向新開強制回應對話方塊傳遞的參數
//sFeatures=(*dialogHeight:sHeight;dialogLeft:sXPos;dialogTop:sYPos;dialogWidth:sWidth;center:{ yes | no | 1 | 0 | on | off };dialogHide:{ yes | no | 1 | 0 | on | off };edge:{ sunken | raised };help:{ yes | no | 1 | 0 | on | off };resizable:{ yes | no | 1 | 0 | on | off };scroll:{ yes | no | 1 | 0 | on | off };status:{ yes | no | 1 | 0 | on | off };unadorned:{ yes | no | 1 | 0 | on | off };*)

showModelessDialog(sURL [, vArguments] [, sFeatures])
//開啟一個非強制回應對話方塊
//vArgument=需要向新開強制回應對話方塊傳遞的參數
//sFeatures=(*dialogHeight:sHeight;dialogLeft:sXPos;dialogTop:sYPos;dialogWidth:sWidth;center:{ yes | no | 1 | 0 | on | off };dialogHide:{ yes | no | 1 | 0 | on | off };edge:{ sunken | raised };help:{ yes | no | 1 | 0 | on | off };resizable:{ yes | no | 1 | 0 | on | off };scroll:{ yes | no | 1 | 0 | on | off };status:{ yes | no | 1 | 0 | on | off };unadorned:{ yes | no | 1 | 0 | on | off };*)

9:execCommand的完全參考(中文版)
document.execCommand(sCommand[,互動方式, 動態參數])

2D-Position;document.execCommand("2D-Position","false","true");使絕對位置的對象可直接拖動;ie5.5
AbsolutePosition;document.execCommand("AbsolutePosition","false","true");使對象定位變成絕對位置;ie5.5
BackColor;document.execCommand("BackColor","false",sColor);設定背景顏色;ie4.0
BlockDirLTR;none;使區塊層級元素排版方式為從左至右?;不支援
BlockDirRTL;none;使區塊層級元素排版方式為從右至左?;不支援 Bold;document.execCommand("Bold","false",null);使選中地區的文字加粗;ie4.0
BrowseMode;none;設定瀏覽器模式?;不支援 Copy;
document.execCommand("Copy","false",null);複製選中的文字到剪貼簿;ie4.0 CreateBookmark;document.execCommand("CreateBookmark","false",sAnchorName);設定指定錨點為書籤;ie4.0
CreateLink;document.execCommand("CreateLink","false",sLinkURL);將選中文本變成超串連,若第二個參數為true,會出現參數設定對話方塊;ie4.0
Cut;document.execCommand("Cut","false",null);剪貼選中的文字到剪貼簿;ie4.0
Delete;document.execCommand("Delete","false",null);刪除選中的文字;ie4.0
DirLTR;none;排版方式為從左至右?;不支援 DirRTL;none;排版方式為從右至左?;不支援
EditMode;none;設定編輯模式?;不支援
FontName;document.execCommand("FontName","false",sFontName);改變選中地區的字型;ie4.0
FontSize;document.execCommand("FontSize","false",sSize|iSize);改變選中地區的字型大小;ie4.0
ForeColor;document.execCommand("ForeColor","false",sColor);設定前景顏色;ie4.0
FormatBlock;document.execCommand("FormatBlock","false",sTagName);設定當前塊的標籤名;ie4.0


視窗一共有四個參數:
window.open(str1,str2,str3,str4)
str1:要開啟的地址:
str2:視窗的名字,可以自訂和取下面的值:
_blank,_parent,_self,_top,_search,[IE5+支援],_media[ie6]。

str3:為屬性值:

str4:是否新開視窗:取:
true或false



相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.