why some thing like this
url="http:/"+"www.pathname.com"+"/"+"anotherString";
turns into http://www.pathname.com/anotherString.
Notice the // after the http:.
why some thing like this
url="http:/"+"www.pathname.com"+"/"+"anotherString";
turns into http://www.pathname.com/anotherString.
Notice the // after the http:.
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.
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.
Its just the way urls are designed, and the way browsers interpret them. For more details see this blog post
An interesting anecdote: Nokia older phones write http:/ instead of http://.