JavaScript Reference/Javascript Collections/namespaces

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

"namespaces" Example

    
<html xmlns:namespace1 xmlns:namespace2>
<button onclick="alert(document.namespaces.length);">Number of namespaces on the page</button>
</body>
</html>



"namespaces" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |document                                                      |
+----------------+--------------------------------------------------------------+



"namespaces" JavaScript properties and JavaScript methods

JavaScript properties and JavaScript methods
 
add(), item(), length



"namespaces" Syntax Parameters and Note

Note:
Returns an array of all the namespace objects in the document.
    
Syntax:
    
document.namespaces // returns all namespaces
document.namespaces(param1) // returns an individual namespace

Parameters: 
    param1   Required; the zero-based index