tags:

views:

76

answers:

4

why some thing like this

url="http:/"+"www.pathname.com"+"/"+"anotherString";

turns into http://www.pathname.com/anotherString. Notice the // after the http:.

+2  A: 

I am not sure what you mean exactly, but if it is in the URL bar of the web-browser, then it is just correcting you. you are meant to have the two forward slashes their. Its just the way you are meant to do it.

thecoshman
A: 

As a string in your file, it does not add an extra / to it, but if you type that string into the browser address bar, the browser will automatically add the additional / to the URL to make it valid. I do believe it will do this for images and other links on the page to make them valid.

animuson
+1  A: 

Its just the way urls are designed, and the way browsers interpret them. For more details see this blog post

Double slash in Web addresses 'a bit of a mistake' and

Berners-Lee 'sorry' for slashes

rahul
I love in the first link, they say the evolution of web3 like there is some function difference to way the WWW works.
thecoshman
+1  A: 

An interesting anecdote: Nokia older phones write http:/ instead of http://.

Nir