JavaScriptのWindowとドキュメントオブジェクトの詳しい配置_基礎知識

WBOY
リリース: 2016-05-16 18:12:06
オリジナル
956 人が閲覧しました
1. ウィンドウオブジェクト
------------------------------------- -------- ------------- ------------------
オブジェクトプロパティ
ウィンドウ //ウィンドウ自体
window.self //このウィンドウを参照 window=window.self
window.name //ウィンドウに名前を付けます
window.defaultStatus // ウィンドウのステータスバー情報を設定します
window.location / /URL アドレス、これを設定します。プロパティは新しいページを開くことができます
-------------------------------------- ----- ---------- --------
オブジェクトメソッド
window.alert("text") //プロンプトメッセージダイアログボックス
window.confirm("text") //確認ダイアログボックス
window.prompt("text") //キーボード入力必須ダイアログボックス
window.setIntervel("action" ,time) //Every 指定した時間 (ミリ秒) ごとに操作を実行します
window.clearInterval() // 時間設定をクリアする機能はサイクルを終了することです
Window.setTimeout(action, time) //指定時間(ミリ秒)経過後 )操作を実行
window.open() //新しいウィンドウを開く
window.close() //ウィンドウを閉じる
----------- -------- ---------------------------------- -------- ---------- --
メンバー オブジェクト
window.event
window.document //詳細はドキュメント オブジェクトを参照
window.history
window.screen
window.navigator
window.external
------------------------------------- ----------- -------------------
window.history object
window.history.length //ページ数seen
history.back( ) //後退
history.forward() //進行
history.go(i) //履歴の i 番目のページに進むか戻ります
//i>0 進歩、私 -------------------------------------- ------------- ------- -------------------
window.screen オブジェクト
ウィンドウ.screen.width //画面の幅
window.screen.height //画面の高さ
window.screen.colorDepth //画面の色の深さ
window.screen.availWidth //利用可能な幅
ウィンドウ。 screen.availHeight //利用可能な高さ(タスクバーの高さを除く)
-------------------------------- ---------------- ---- -------------------
window.external オブジェクト
ウィンドウ.external.AddFavorite("Address", "Title" ) // ウェブサイトをお気に入りに追加
---------------------------- ------------ ---------- -------------------
window.navigator オブジェクト
window.navigator.appCodeName //ブラウザコード名
window.navigator.appName //ブラウザプログラム名
window.navigator.appMinorVersion //ブラウザパッチバージョン
window.navigator.cpuClass //cpuタイプ x86
window.navigator.platform //オペレーティング システムの種類 win32
window.navigator.plugins
window.navigator.opsProfile
window.navigator.userProfile
window.navigator.systemLanguage //顧客システムlanguage zh-cn 簡体字中国語
window.navigator.userLanguage //ユーザー言語、上記と同じ
window.navigator.appVersion //ブラウザのバージョン (システムバージョンを含む)
window.navigator.userAgent
window.navigator.onLine //ユーザーはオンラインですか?
window.navigator.cookieEnabled //ブラウザが Cookie をサポートしているかどうか
window.navigator.mimeTypes
============ ============ ==========================

2.オブジェクト

Object properties:
document.title //Set the document title equivalent to the HTML tag <br>document.bgColor //Set the page background color <br>document.fgColor //Set the foreground color ( Text color) <br>document.linkColor //Color of links that have not been clicked<br>document.alinkColor //Color of active links (focus is on this link)<br>document.vlinkColor //Color of links that have been clicked <br>document.URL //Set URL properties to open another webpage in the same window<br>document.fileCreatedDate //File creation date, read-only attribute<br>document.fileModifiedDate //File modified date, read-only attribute<br>document.fileSize //File size, read-only attribute<br>document.cookie //Set and read cookies <br>document.charset //Set character set Simplified Chinese: gb2312 <br>------ ----------------------- <br><br>Common object methods<br><br>document.write() //Dynamicly write content to the page <br>document.createElement(Tag) //Create an html tag object<br>document.getElementById(ID) //Get the object with the specified ID value<br>document.getElementsByName(Name) //Get the object with the specified Name value <br>document.body.appendChild(oTag) <br><br>body-body sub-object<br><br>document.body //Specifying the start and end of the document body is equivalent to
document.body.bgColor //Set or get the background color behind the object
document.body.link //Color of unclicked links
document.body.alink //Activate link (focus is on this link) above)
document.body.vlink //Color of clicked link
document.body.text //Text color
document.body.innerText //Settings...document.body.innerHTML //Set the HTML code between
...document.body.topMargin //The top margin of the page
document.body .leftMargin //Left margin of the page
document.body.rightMargin //Right margin of the page
document.body.bottomMargin //Bottom margin of the page
document.body.background //Background image
document. body.appendChild(oTag) //Dynamicly generate an HTML object
Common object events

document.body.onclick="func()" //Clicking the object with the mouse pointer is triggered
document. body.onmouseover="func()" //Triggered when the mouse pointer moves to the object
document.body.onmouseout="func()" //Triggered when the mouse pointer moves out of the object
location-location sub-object
document.location.hash // The part after #
document.location.host // Domain name port number
document.location.hostname // Domain name
document.location.href // Full URL
document.location.pathname // Directory part
document.location.port // Port number
document.location.protocol // Network protocol (http:)
document.location.search // ? The part after the number

Common object events
documeny.location.reload() //Refresh the web page
document.location.reload(URL) //Open a new web page
document.location .assign(URL) //Open a new web page
document.location.replace(URL) //Open a new web page
==================== ================================================== ===
selection-selection sub-object
document.selection
============================== ==========================================
images collection (in the page images):
----------------------------
a) Reference
document.images through the collection //The corresponding
tag on the pageJavaScriptのWindowとドキュメントオブジェクトの詳しい配置_基礎知識document.images.length //The number of
tags on the corresponding pageJavaScriptのWindowとドキュメントオブジェクトの詳しい配置_基礎知識document.images[0] //The first
tagJavaScriptのWindowとドキュメントオブジェクトの詳しい配置_基礎知識document.images[i] //i-1th
tagJavaScriptのWindowとドキュメントオブジェクトの詳しい配置_基礎知識-------------------------------
b) Directly reference

JavaScriptのWindowとドキュメントオブジェクトの詳しい配置_基礎知識document.images.oImage //document.images.name attribute
---------------- through nane attribute ------------
c) Reference the src attribute of the image
document.images.oImage.src //document.images.name attribute.src
----- -----------------------
d) Create an image
var oImage
oImage = new Image()
document .images.oImage.src="1.jpg"
At the same time, create a
tag on the page corresponding to it to display JavaScriptのWindowとドキュメントオブジェクトの詳しい配置_基礎知識---------------- ------------
Sample code (dynamic creation of images):


JavaScriptのWindowとドキュメントオブジェクトの詳しい配置_基礎知識




関連ラベル:
ソース:php.cn
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!