javascript
window.location.host #returns host
window.location.hostname #returns hostname
window.location.pathname #return pathname
window.location.href #returns full current url
window.location.port #returns the port
window.location.protocol #returns the protocol
jQuery
$(location).attr('host'); #returns host
$(location).attr('hostname'); #returns hostname
$(location).attr('pathname'); #returns pathname
$(location).attr('href'); #returns href
$(location).attr('port'); #returns port
$(location).attr('protocol'); #returns protocol
참고사이트 : http://stackoverflow.com/questions/406192/get-current-url-in-javascript