JavaScript Reference/Javascript Properties/domain

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

"domain" Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
    var m = document.domain;
    if (m) {
        alert(m);
    } else {
        alert("No security domain");
    }
}
</script>
<input type="button" onClick="function1();" value="Domain Name">
</body>
</html>



"domain" is applied to

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



"domain" Syntax and Note

Note:
Read and write property. 
Sets the document security domain name.
    
Syntax:
    
document.domain = value