I plan on buying two domain names for the same site. Depending on which domain is used I plan on providing slightly different data on the page. Is there a way for me to de
If you want to get domain name in JavaScript, just use the following code:
var domain_name = document.location.hostname; alert(domain_name);
If you need to web page URL path so you can access web URL path use this example:
var url = document.URL; alert(url);