document.domain of a page

If we are running a script in a website or in our localhost we can find out the domain name of the website by using document.domain property. Say we have developed a script which can work in multiple domains and we need to find out the present domain name for our processing.

Here is the syntax of our domain property of document object.

document.domain

The output for this page will be Here is the code.

<html>
<head>
<title></title>
<script type="text/javascript">
document.write(document.domain);
</script>
</head>
<body>

</body>
</html>

Number of User Comments : 1


Google+

danish

19-03-2015

Thanks very much solve the problem :) God bless you

Post Comment This is for short comments only. Use the forum for more discussions.






HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2015 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer