TOC PREV NEXT INDEX

Put your logo here!


domain


domain returns the domain of the current document.

Syntax

domain_name = document.domain 

Parameters

domain_name is a string referring to the domain of the current document.

Example

bad_domain = "www.love.com"; 
if ( document.domain == bad_domain ) { 
   window.close(); 
} 
// for document www.love.com/good.html,  
// this script closes the window 

Notes

This property returns NULL if the server of the document cannot be identified.

Specification

html


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX