[X]

JScript Conditional Compilation

browser wars 1997 dead

Code hidden inside a comment that one engine compiled and every other ignored.

In 2026: Dead with Internet Explorer. To everyone else this is a comment, so the script is safe to ship. It was the neatest browser filter of the lot and almost nobody used it.

Where it came from: Microsoft JScript 3.0 documentation, 1997. Wikipedia

<script type="text/javascript">
var engine = "not JScript";
/*@cc_on
  @if (@_jscript_version >= 5.5)
    engine = "JScript " + @_jscript_version;
  @else
    engine = "old JScript";
  @end
@*/
document.write("Script engine: " + engine);
</script>
sandboxed demo · breaks nothing but itselfrestart

More in browser wars

all 19 in browser wars › · the whole library ›