In javascript, how can I get the relative path of the current url?
for example http://www.example.com/test/this?page=2
http://www.example.com/test/this?page=2
I want just the /te
/te
You should use it the javascript way, to retrieve the complete path including the extensions from the page,
$(location).attr('href');
So, a path like this, can be retrieved too.
www.google.com/results#tab=2