Output document domain in JavaScript

Description

The following code shows how to output document domain.

Example


<!--   w  w  w . ja  v  a2 s  . co  m-->
<!DOCTYPE HTML>
<html>
<body>
<script>

document.writeln("domain: " + document.domain);
</script>
</body>
</html>

Click to view the demo

The code above generates the following result.

Output document domain in JavaScript