tag:blogger.com,1999:blog-11788780.post114245140142332363..comments2023-12-29T13:22:33.104-08:00Comments on JJinuxLand: HTML: Escaping &'s in URLs in HTMLjjinuxhttp://www.blogger.com/profile/03270879497119114175noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-11788780.post-43539454807632111592007-05-05T03:00:00.000-07:002007-05-05T03:00:00.000-07:00Sounds like '&' is a bad choice anyway if it can b...Sounds like '&' is a bad choice anyway if it can be confused with an SGML element. Quote from http://www.w3.org/TR/html401/appendix/notes.html#h-B.2.2<BR/><BR/><I>We recommend that HTTP server implementors, and in particular, CGI<BR/> implementors support the use of ";" in place of "&" to save authors<BR/> the trouble of escaping "&" characters in this manner.<BR/></I>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11788780.post-1142885305052128572006-03-20T12:08:00.000-08:002006-03-20T12:08:00.000-08:00DHTML Utopia: Modern Web Design Using JavaScript &...<A HREF="http://www.sitepoint.com/books/dhtml1/" REL="nofollow">DHTML Utopia: Modern Web Design Using JavaScript & DOM</A> made a pretty strong case against using XHTML. For those that care about this problem, they'll have to use $htmlent. That is, it's possible to do THE RIGHT THING. It's just frustrating that I can't make doing the right thing much easier :-/jjinuxhttps://www.blogger.com/profile/03270879497119114175noreply@blogger.comtag:blogger.com,1999:blog-11788780.post-1142564724716017072006-03-16T19:05:00.000-08:002006-03-16T19:05:00.000-08:00It's worth noting that failing to escape ampersand...It's worth noting that failing to escape ampersands (in URLs or anywhere else) precludes you from publishing XHTML, as most browsers and other clients use a validating parser, which will choke on the first '&name=bob' in a URL. And you won't have any sort of notification of this problem with your site logged on the server, just a user with a confusing, ugly error message where your page should be.<BR/><BR/>I suppose serving any XHTML as text/html is a "works in enough browsers" means of avoiding the validating parser, but if you don't want to go through the pain of making valid XML, I strongly recommend using HTML4. By not using invalid XHTML, you don't have to worry about redoing all your XHTML pages if you ever change servers (in the case that the new server uses one of the other valid content-types for XHTML).Anonymousnoreply@blogger.com