relative URL seems to be interpreted incorrectly by the browser

390 Views Asked by At

I have a relative URL on a page, which is being interpreted relative to the root (instead of relative to the current doc). Can't figure out why.

On page:

http://vm:8080/docs

There is a tag:

<a rel="nofollow" href="_sources/index.txt">Show Source</a>

The browser resolves this to:

http://vm:8080/_sources/index.txt

Instead of:

http://vm:8080/docs/_sources/index.txt

Here is some information for the anchor from the DOM.

origin     http://vm:8080
baseURI    http://vm:8080/docs
pathname   /_sources/index.txt
href       http://sanjay-vm:8080/_sources/index.txt

Why is the browser adding a leading slash to the pathname?

0

There are 0 best solutions below