Links

Home arrow Articles arrow Programming arrow How to get the current http host url with javascript
How to get the current http host url with javascript PDF Print E-mail
Tag it:
Delicious
blogmarks
Stumble
Furl it!
Digg
YahooMyWeb
Technorati
User Rating: / 10
PoorBest 

This function returns the url of the current site. Its really handy if you move code from development to production frequently and dont want to deal with the hassle of running a linux find replace script to update URL's within the code.

Comments
Search
Only registered users can write comments!
catalint   |82.76.73.xxx |2010-10-12 06:07:56
Please use: window.location.hostname

and a http host doesn not include http
...(what do you do when you have https?)
Last Updated ( Wednesday, 22 July 2009 )
 
< Prev