検索
ホームページウェブフロントエンドjsチュートリアルJavaScriptのWindowとドキュメントオブジェクトの詳しい配置_基礎知識

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.
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とドキュメントオブジェクトの詳しい配置_基礎知識




声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
JavaScriptはCで書かれていますか?証拠を調べるJavaScriptはCで書かれていますか?証拠を調べるApr 25, 2025 am 12:15 AM

はい、JavaScriptのエンジンコアはCで記述されています。1)C言語は、JavaScriptエンジンの開発に適した効率的なパフォーマンスと基礎となる制御を提供します。 2)V8エンジンを例にとると、そのコアはCで記述され、Cの効率とオブジェクト指向の特性を組み合わせて書かれています。3)JavaScriptエンジンの作業原理には、解析、コンパイル、実行が含まれ、C言語はこれらのプロセスで重要な役割を果たします。

JavaScriptの役割:WebをインタラクティブでダイナミックにするJavaScriptの役割:WebをインタラクティブでダイナミックにするApr 24, 2025 am 12:12 AM

JavaScriptは、Webページのインタラクティブ性とダイナミズムを向上させるため、現代のWebサイトの中心にあります。 1)ページを更新せずにコンテンツを変更できます。2)Domapiを介してWebページを操作する、3)アニメーションやドラッグアンドドロップなどの複雑なインタラクティブ効果、4)ユーザーエクスペリエンスを改善するためのパフォーマンスとベストプラクティスを最適化します。

CおよびJavaScript:接続が説明しましたCおよびJavaScript:接続が説明しましたApr 23, 2025 am 12:07 AM

CおよびJavaScriptは、WebAssemblyを介して相互運用性を実現します。 1)CコードはWebAssemblyモジュールにコンパイルされ、JavaScript環境に導入され、コンピューティングパワーが強化されます。 2)ゲーム開発では、Cは物理エンジンとグラフィックスレンダリングを処理し、JavaScriptはゲームロジックとユーザーインターフェイスを担当します。

Webサイトからアプリまで:JavaScriptの多様なアプリケーションWebサイトからアプリまで:JavaScriptの多様なアプリケーションApr 22, 2025 am 12:02 AM

JavaScriptは、Webサイト、モバイルアプリケーション、デスクトップアプリケーション、サーバー側のプログラミングで広く使用されています。 1)Webサイト開発では、JavaScriptはHTMLおよびCSSと一緒にDOMを運用して、JQueryやReactなどのフレームワークをサポートします。 2)ReactNativeおよびIonicを通じて、JavaScriptはクロスプラットフォームモバイルアプリケーションを開発するために使用されます。 3)電子フレームワークにより、JavaScriptはデスクトップアプリケーションを構築できます。 4)node.jsを使用すると、JavaScriptがサーバー側で実行され、高い並行リクエストをサポートします。

Python vs. JavaScript:ユースケースとアプリケーションと比較されますPython vs. JavaScript:ユースケースとアプリケーションと比較されますApr 21, 2025 am 12:01 AM

Pythonはデータサイエンスと自動化により適していますが、JavaScriptはフロントエンドとフルスタックの開発により適しています。 1. Pythonは、データ処理とモデリングのためにNumpyやPandasなどのライブラリを使用して、データサイエンスと機械学習でうまく機能します。 2。Pythonは、自動化とスクリプトにおいて簡潔で効率的です。 3. JavaScriptはフロントエンド開発に不可欠であり、動的なWebページと単一ページアプリケーションの構築に使用されます。 4. JavaScriptは、node.jsを通じてバックエンド開発において役割を果たし、フルスタック開発をサポートします。

JavaScript通訳者とコンパイラにおけるC/Cの役割JavaScript通訳者とコンパイラにおけるC/Cの役割Apr 20, 2025 am 12:01 AM

CとCは、主に通訳者とJITコンパイラを実装するために使用されるJavaScriptエンジンで重要な役割を果たします。 1)cは、JavaScriptソースコードを解析し、抽象的な構文ツリーを生成するために使用されます。 2)Cは、Bytecodeの生成と実行を担当します。 3)Cは、JITコンパイラを実装し、実行時にホットスポットコードを最適化およびコンパイルし、JavaScriptの実行効率を大幅に改善します。

JavaScript in Action:実際の例とプロジェクトJavaScript in Action:実際の例とプロジェクトApr 19, 2025 am 12:13 AM

現実世界でのJavaScriptのアプリケーションには、フロントエンドとバックエンドの開発が含まれます。 1)DOM操作とイベント処理を含むTODOリストアプリケーションを構築して、フロントエンドアプリケーションを表示します。 2)node.jsを介してRestfulapiを構築し、バックエンドアプリケーションをデモンストレーションします。

JavaScriptとWeb:コア機能とユースケースJavaScriptとWeb:コア機能とユースケースApr 18, 2025 am 12:19 AM

Web開発におけるJavaScriptの主な用途には、クライアントの相互作用、フォーム検証、非同期通信が含まれます。 1)DOM操作による動的なコンテンツの更新とユーザーインタラクション。 2)ユーザーエクスペリエンスを改善するためにデータを提出する前に、クライアントの検証が実行されます。 3)サーバーとのリフレッシュレス通信は、AJAXテクノロジーを通じて達成されます。

See all articles

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

SecLists

SecLists

SecLists は、セキュリティ テスターの究極の相棒です。これは、セキュリティ評価中に頻繁に使用されるさまざまな種類のリストを 1 か所にまとめたものです。 SecLists は、セキュリティ テスターが必要とする可能性のあるすべてのリストを便利に提供することで、セキュリティ テストをより効率的かつ生産的にするのに役立ちます。リストの種類には、ユーザー名、パスワード、URL、ファジング ペイロード、機密データ パターン、Web シェルなどが含まれます。テスターはこのリポジトリを新しいテスト マシンにプルするだけで、必要なあらゆる種類のリストにアクセスできるようになります。

SublimeText3 英語版

SublimeText3 英語版

推奨: Win バージョン、コードプロンプトをサポート!

AtomエディタMac版ダウンロード

AtomエディタMac版ダウンロード

最も人気のあるオープンソースエディター

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境