Hiding VBScript and JavaScript from Old Browsers

Web page “graceful degradation” means making new capabilities invisible to older browsers that don’t support them. Many authors hide VBScript or JavaScript code inside an HTML comment so that older browsers will not display the code in the middle of the Web page. However, some older browsers such as Lynx and Mosaic recognize the greater-than symbol (>) as an end of comment rather than the full end of comment string (“–>”). For anyone using these browsers, scripts using a “>” sign will cause the rest of the script after the “>” sign to display onscreen. To get around this, use “<" expressions instead of ">” expressions, replace “>” with the characters “76”, and replace “>>” operators with division by a power of two.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: