JavaScript Reference/Javascript Objects/namespace

Материал из Web эксперт
Перейти к: навигация, поиск

"namespace" Event handlers

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |onReadyStateChange | +----------------+--------------------------------------------------------------+

     </source>
   
  


"namespace" Example

   <source lang="javascript">
   

<html xmlns:namespace1 xmlns:namespace2> <button onclick="alert(document.namespaces(0).name);"> Name of first namespace on the page </button> </body> </html>


     </source>
   
  


"namespace" is applied to

   <source lang="javascript">

Names noted with an asterisk (*) are JavaScript properties only. +----------------+--------------------------------------------------------------+ | Applied_To |namespaces* | +----------------+--------------------------------------------------------------+

     </source>
   
  


"namespace" JavaScript Methods

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | JavaScript |attachEvent detachEvent | | Methods |doImport | +----------------+--------------------------------------------------------------+

     </source>
   
  


"namespace" JavaScript Properties

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | JavaScript |name readyState | | Properties |urn | +----------------+--------------------------------------------------------------+

     </source>
   
  


"namespace" Syntax and Note

   <source lang="javascript">

Note: Embed an element"s behavior into the document. You can only access the namespace object by referencing the desired index in the namespaces collection.

Syntax:

document.namespaces(index).memberName


     </source>