Forum Moderators: open
I have been noticing more and more form elements, links to stylesheets, etc. with the trailing forward slash (/) as displayed above.
Am I missing something?
Is this a valuable thing to include?
Does it help a spider?
A browser to render faster?
Does this matter when linking to a URL in an href("http://www.anysite.com/" instead of just using "http://www.anysite.com"?
Pardon my ignorance on something that is probably very, very basic. This isn't something that we use and I want to be sure we aren't causing trouble for spiders or browsers by neglecting to use this.
Thanks for any responses.
For your second example, using the trailing slash in an URL, either in a link to the root page (example.com/) or to a directory (example.com/directory/) is highly recommended, as you are avoiding a server-side redirect to the correct address.
We do validate and don't have any issues there. However, it seemed odd to me that I was seeing this more and more at other sites and had no idea what it was there for.
My main concern was that it was in the form elements such as 'text'. I thought it might have something to do with the way that some of the lesser used browsers like the Mac browser or Firefox read the page.
If anyone has any additional input it is appreciated.
Thanks.
roblaw
Some of it may come from using copy and paste for chunks of mark-up, and some of it from carelessness or sheer ignorance. Because the mark-up doesn't break in most browsers, I expect we'll see it more and more.
It's much the same in other systems: a certain amount of "future-proofing" has pushed (usually in error) the builders of such systems to use XHTML notation by default, even if their templates remain the invalid, tables-based, tag soup variety. Also, until a few months back, the W3 validator accepted XHTML notation within an HTML document, so many such systems "validated" solely because of the way that the validator handled the issue.
[edited by: encyclo at 6:40 pm (utc) on Feb. 3, 2005]