How can I get the domain name with jquery ??
+2
A:
You don't need jQuery for this, as simple javascript will suffice:
alert(document.domain);
See it in action: http://jsbin.com/eceko
For further domain-related values, check out the properties of window.location
online at https://developer.mozilla.org/En/DOM/Window.location
Jonathan Sampson
2010-02-20 02:22:09
+1
A:
Similar to the answer before there there is
location.host
The location global has more fun facts about the current url as well. ( protocol, host, port, pathname, search, hash )
bibby
2010-02-20 08:40:11