Get url with Javascript without GET

3

I'm getting my url like this:

var url = window.location.href;

I have the following return: link .

But I do not want the part of GET, I wanted to get the url like this: link

How could I do it?

    
asked by anonymous 08.12.2015 / 17:17

1 answer

3

Try to get only the path

var url = window.location.pathname
    
08.12.2015 / 17:21