


一般的な JavaScript メソッド、属性コレクション、および NodeList スキルと HTMLCollection_javascript スキルのブラウザの違い
interface HTMLCollection
{
readonly attribute unsigned long length;
Node item(in unsigned long index);
Node namedItem(in DOMString name);
}
对于 HTMLCollection集合对象 必须要说一说的是 namedItem方法. 看看规范的解释.
原文:
namedItem method This method retrieves a Node using a name. With [HTML 4.01] documents, it first searches for a Node with a matching id attribute. If it doesn't find one, it then searches for a Node with a matching name attribute, but only on those elements that are allowed a name attribute. With [XHTML 1.0] documents, this method only searches for Nodes with a matching id attribute. This method is case insensitive in HTML documents and case sensitive in XHTML documents. 翻译:
namedItem 方法:
此方法获通过 "name"属性来获取节点.
在HTML4.01文档中,它首先搜索的是节点的ID属性的值. 如果没找到匹配节点,才去搜索name 属性与之匹配的节点. 即HTML4.01 DTD下,浏览器们应该优先通过ID来获取节点.其次才是name.
在XHTML 1.0文档中,则仅搜索ID与之匹配的节点.
对于节点(id or name)属性的值,此方法在HTML文档中忽略大小写区别,而在XHTML文档中.则要区别大小写.
|
interface NodeList {
Node item(in unsigned long index);
readonly attribute unsigned long length;
};
微软MSDN上查到的 NodeList实现 ,虽然这些资料告诉我们 NodeList继承了 Microsoft.SpeechServer.Dom.Collections.Collection Class . 但是事实却并不如此. 事实上,ie浏览器的NodeList不具备 ICollection接口定义的 namedItem 和 tags 两个方法. 实现了他们的 只有HTMLCollection类型.
此文档是 Speech Server 2007 用的,所以应该仅供参考.只能说明IE浏览器中的NodeList 还是遵守标准的.
<strong><span><span style="COLOR: #a8a8a8">public sealed class NodeList : Collection, INodeList, IEnumerable, IExpando, IReflect</span></span></strong> <span style="COLOR: #a8a8a8"><strong><span><span><strong><span style="COLOR: #a8a8a8">NodeList的继承链:</span></strong></span></span></strong></span>
System.Object
Microsoft.SpeechServer.Dom.Shim
Microsoft.SpeechServer.Dom.DynamicShim
Microsoft.SpeechServer.Dom.Collections.Collection
Microsoft.SpeechServer.Dom.Collections.NodeList
Collection 实现的ICollection接口定义的属性和方法表
public properties : item(msdn上说item是重载,我表示诧异...),length
public methods : item,namedItem,tags
|
Element querySelector(in DOMString selectors);
NodeList querySelectorAll(in DOMString selectors);
}
The NodeList object returned by the querySelectorAll() method must be static, not live ([DOM-LEVEL-3-CORE], section 1.1.1)
Members Table
The following table lists the members exposed by the StaticNodeList object.
Attributes/PropertiesMethods
Method Description item Retrieves an object from a childNodes or StaticNodeList collection.
Remarks
The collection will be empty if the querySelectorAll method returned no matches.
If the element tree is changed relative to the one or more original selectors used to generate the StaticNodeList collection, the collection (being static) will not be updated when the element tree changes.
限定方
|
方法\浏览器 | IE8 | IE9 beta7930.16406 | FireFox4.0 beta7 | Chrome10.0 Dev | Safari5.02 | Opear11 |
W3C DOM2 | getElementsByTagName |
HTMLCollection |
HTMLCollection
|
HTMLCollection
|
NodeList
|
NodeList
|
NodeList
|
WHATWG HTML5
|
getElementsByClassName |
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
NodeList
|
NodeList
|
NodeList
|
W3C DOM1
|
getElementsByName |
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
NodeList
|
NodeList
|
NodeList
|
W3c Selectors API 1
|
querySelectorAll | StaticNodeList |
StaticNodeList
|
NodeList(Static)(注0) |
NodeList(Static)
|
NodeList(Static)
|
NodeList(Static)
|
W3C DOM1
|
childNodes | NodeList |
NodeList
|
NodeList
|
NodeList
|
NodeList
|
NodeList
|
MS
|
children
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
w3c DOM1 |
document.links
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
w3c DOM1
|
document.images |
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
w3c DOM1
|
document.anchors |
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
w3c DOM1
|
document.forms |
HTMLCollection |
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
w3c DOM1 | document.applets |
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
w3c DOM1 | formElement.elements |
HTMLFormElement |
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
w3c DOM1 | selectElement.options |
HTMLSelectElement
|
HTMLSelectElement
|
HTMLOptionsCollection
|
HTMLOptionsCollection
|
HTMLOptionsCollection
|
HTMLOptionsCollection
|
w3c DOM1 | tableElement.rows |
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
w3c DOM1 | rowElement.cells |
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
HTMLCollection
|
MS | document.all |
HTMLCollection
|
HTMLCollection
|
(S)-(注4)
(Q)object HTML document.all class
|
HTMLAllCollection(注1)
|
HTMLAllCollection(注2)
|
HTMLCollection(注3)
|
Note 4: Freifox only supports document.all in non-standard mode and it is a very strange thing. Its constructor is Object. This thing seems to have been available since the FireFox 0.8 era. Until now 4.0 beta8...

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

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

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

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

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

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

JavaScriptエンジンが内部的にどのように機能するかを理解することは、開発者にとってより効率的なコードの作成とパフォーマンスのボトルネックと最適化戦略の理解に役立つためです。 1)エンジンのワークフローには、3つの段階が含まれます。解析、コンパイル、実行。 2)実行プロセス中、エンジンはインラインキャッシュや非表示クラスなどの動的最適化を実行します。 3)ベストプラクティスには、グローバル変数の避け、ループの最適化、constとletsの使用、閉鎖の過度の使用の回避が含まれます。

Pythonは、スムーズな学習曲線と簡潔な構文を備えた初心者により適しています。 JavaScriptは、急な学習曲線と柔軟な構文を備えたフロントエンド開発に適しています。 1。Python構文は直感的で、データサイエンスやバックエンド開発に適しています。 2。JavaScriptは柔軟で、フロントエンドおよびサーバー側のプログラミングで広く使用されています。


ホットAIツール

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

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

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

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

人気の記事

ホットツール

AtomエディタMac版ダウンロード
最も人気のあるオープンソースエディター

Dreamweaver Mac版
ビジュアル Web 開発ツール

PhpStorm Mac バージョン
最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

mPDF
mPDF は、UTF-8 でエンコードされた HTML から PDF ファイルを生成できる PHP ライブラリです。オリジナルの作者である Ian Back は、Web サイトから「オンザフライ」で PDF ファイルを出力し、さまざまな言語を処理するために mPDF を作成しました。 HTML2FPDF などのオリジナルのスクリプトよりも遅く、Unicode フォントを使用すると生成されるファイルが大きくなりますが、CSS スタイルなどをサポートし、多くの機能強化が施されています。 RTL (アラビア語とヘブライ語) や CJK (中国語、日本語、韓国語) を含むほぼすべての言語をサポートします。ネストされたブロックレベル要素 (P、DIV など) をサポートします。

EditPlus 中国語クラック版
サイズが小さく、構文の強調表示、コード プロンプト機能はサポートされていません
