To get current domain name of the page.

Code Snippet

window.location.host

or

document.domain

Sample Usage

var current_domain = document.domain;

Note

window.location.host document.domain




author's photo

Author : Blue Cloud

Just a normal software developer who love to write code. Developing professional software since 1999. After working in the software industry for many years, I've started my own website to share knowledges and experiences.

COMMENTS
blog comments powered by Disqus