• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 14. Conditional Compilation in I... > Compatibility with Netscape Browsers

Compatibility with Netscape Browsers

Netscape under no circumstances allows an object to start with the @ symbol. Microsoft recognized this, and allows us to write conditional compilation statements enclosed in JavaScript comments, as seen in Listing 14.2.

Listing 14.2. Commenting Out Conditional Compilation

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title></title></head>
<body>
<script language="JavaScript" type="text/javascript">
<!--
/*@cc_on@*/
/*@if (@_win32) alert("Politically Correct");
 @else@*/alert("Return of the Mac");
/*@end@*/
//-->
</script>
</body>
</html>


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint