@_mac

JScript3.0+Syntax

@_mac

Description

The @_mac variable is used in conditional compilation to determine if an Apple Macintosh system is being used. When the variable is not true, it is defined as NaN.

Example

Listing 9.5 alerts the user when an Apple Macintosh system is used.

Listing 9.5 Detect an Apple Macintosh System
<script language="JScript">
<!-- Hide

@if (@_mac)
  alert("You are using an Apple Macintosh system.");
@else
  alert("You are NOT using an Apple Macintosh system.");
@end

//Hide End -->
</script>
						

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.