Sunday, June 15, 2008

How to get host name in JavaScript?


To get host name in JavaScript -
HTTP_HOST

var hostname = window.location.hostname


2 comments:

Anonymous said...

this doesnot work....!!!! :-(

Bea said...

for me it worked!