[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Netscape7.1 bug or bad code?
> From: David Carlisle [mailto:davidc@xxxxxxxxx] > Sent: Wednesday, July 02, 2003 3:52 AM > Subject: Re: Netscape7.1 bug or bad code? > > > > > the JavaScript isn't ignored in Netscape Version 7.02. > > I don't know but maybe market forces of keeping users happy > outweighed the > logically correct behaviour of treating a comment as a comment... This is OT, but the original reason for wrapping comment tags around JavaScript (the code, not the script tags) was so that older browsers that didn't understand <script/> wouldn't output the code as literal text. Now that every browser released over the past six or seven years is at least script-aware, the need for comment tags has been eliminated. Some old-timers insist on using them, however. BTW, this will cause problems in output: <script> <xsl:comment> alert("This is a script"); </xsl:comment> </script> This will be output as: <script> <!-- alert("This is a script"); --> </script> which will break most JS interpreters because they will parse the close comment tag as a decrement operator, then get confused by the right angle bracket. If you do this in XSLT, you have to add a JS comment delimiter before closing the comment: // </xsl:comment> cheers, b. | brian martinez brian.martinez@xxxxxxxxxxx | | lead gui programmer 303.357.3548 | | cheap tickets, part of trip network fax 303.357.3380 | | 6560 greenwood plaza blvd., suite 400 englewood, co 80111 | | cendant travel distribution services http://www.cheaptickets.com/ | XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|