Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.3.3

Request #9497 javascript back- and forward compatibillity
Submitted: 2006-11-29 13:28 UTC
From: pear_dev at willfris dot nl Assigned: wiesemann
Status: Closed Package: HTML_QuickForm_DHTMLRulesTableless
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2006-11-29 13:28 UTC] pear_dev at willfris dot nl (W. Fris)
Description: ------------ As stated on http://hixie.ch/advocacy/xhtml: * <script> and <style> elements in XHTML sent as text/html have to be escaped using ridiculously complicated strings. This is because in XHTML, <script> and <style> elements are #PCDATA blocks, not #CDATA blocks, and therefore <!-- and --> really _are_ comments tags, and are not ignored by the XHTML parser. To escape script in an XHTML document which may be handled as either HTML4 or XHTML, you have to use: <script type="text/javascript"><!--//--><![CDATA[//><!-- ... //--><!]]></script> Expected result: ---------------- line 122: //<![CDATA[ becomes: <!--//--><![CDATA[//><!-- line 243: //]]> becomes: //--><!]]> (Maybe also clear the 4 spaces on line 145)

Comments

 [2006-11-29 20:49 UTC] wiesemann (Mark Wiesemann)
I don't really like the suggested solution. The page states: | (This is all assuming you want your pages to work with | older browsers as well as XHTML browsers. If you only | care about XHTML and HTML4 browsers, you can make it a | bit simpler.) My tableless renderer generates valid XHTML. And XHTML is understood by all modern browsers, so I don't see a reason to be compliant to very old browsers. Using <!-- and --> was needed a "long" time ago, but such browsers might not even know that XHTML exists. Do you have found any problems with a browser regarding this issue?
 [2006-11-29 21:33 UTC] pear_dev at willfris dot nl
I have not found any problems with a browser regarding this issue. | My tableless renderer generates valid XHTML. And XHTML is | understood by all modern browsers, so I don't see a | reason to be compliant to very old browsers. | Using <!-- and --> was needed a "long" time ago, | but such browsers might not even know that XHTML exists. They don't indeed and why support that old stuff? Just keep it from generating errors... I must say the php-code behind the javascript code I find quite impressing. And I am still figering(is that correct english?) out how it works, if I find something, I'll post it here.
 [2006-11-30 19:15 UTC] wiesemann (Mark Wiesemann)
| I must say the php-code behind the javascript code I | find quite impressing. Thanks, most parts are originally from Justin Patrin (search for his name and "DHTMLRules" if you want to know more). I have done the rewriting for my tableless renderer and have done some fixes and optimizations for groups of elements (not supported by Justin's code). | And I am still figering(is that correct english?) out | how it works, if I find something, I'll post it here. "figuring" might be the right spelling, but I'm also not a native English speaker. Please give me short hint on your opinion: Do you agree with me that the current "//<![CDATA[" usage is okay or would say that it is better to use the notation as on the hixie.ch page? Greetings from the German-Dutch border (Aachen / Aken), Mark
 [2006-12-02 14:51 UTC] pear_dev at willfris dot nl
| Please give me short hint on your opinion: Do you agree | with me that the current "//<![CDATA[" usage is okay or | would say that it is better to use the notation as on | the hixie.ch page? I personally would prefer supporting backward compatibillity. Especially as this makes it usable for a wider group and because it doesn't break down the upward compatibillity. Then again you could keep it like this and demand an upgrade from those old-browser-using-users. Groeten, Will. Near A'dam, NL ;)
 [2006-12-04 20:34 UTC] wiesemann (Mark Wiesemann)
I've fixed this request in CVS and made a new release. You are right: supporting older browsers does not hurt, as long as current browsers don't get problems with it.