Home Forums DITA and XMetaL Discussion Spaces in the URL Reply To: Spaces in the URL


Reply to: Spaces in the URL

I'm still a little confused because I'm not sure why having the %20 in the URL is a concern. Did your website people give a reason? You say the project manager doesn't allow spaces. So, because there are no spaces in the URL I'm not sure what the issue is. Or are they saying the %20 and space are identical (ie: it is not that the URL is illegal, it is that they think %20 is ugly)?

I'm not sure that I understand it either. Today, when I asked about it, “it's not a problem”. Perhaps I misunderstood. So, maybe I'll just put this issue on hold for now and see if it comes up again. If so, I'll have to defer to someone who knows JavaScript.

The thing that might be confusing everyone here is that different browsers display %20 differently in the address bar. In some browsers if a URL contains %20 it is rendered as %20 (IE is one) and some browsers “help” you by rendering the %20 as a space (presumably because this is easier to read and understand). Our code is telling the browser to use %20, it is the browser that is rendering a space, not us (this is true for FireFox). If you have both browsers installed and open the same output in each you should see what I mean.

I do, I did, and I do.

One thing that bothers me about the portion of code I posted before is that it checks for spaces before it takes the title from the TOC. At least, that's the way it appears to me. But I don't know enough about JS to even begin making revisions.

Anyway, if it does come up again as a concern, I have you post to refer to, so thanks for the info.