Wednesday, August 19, 2009

Get url without filename

var path = window.location.href.substr(0, location.href.lastIndexOf("/") + 1)

2 comments:

Unknown said...

Thanks, it works

m k said...

This will not work if url is like http://www.test.com