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>

document Object URL of a Page
Subscribe to our YouTube Channel here



plus2net.com







danish

19-03-2015

Thanks very much solve the problem :) God bless you



We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer