eval(code) Navigator 2.0, Internet Explorer 3.0 object.eval(code) Navigator 3.0
The value of the evaluated code, if any.
In Navigator 2.0 and Internet Explorer 3.0, eval() evaluates the specified code in the context of the current Window object. In Navigator 3.0, it evaluates the code in the context of the object through which it is invoked. Thus, in Navigator 3.0, when you use eval() without an object specified to its left, it is implicitly invoked through the current window object, and its behavior is the same as in Navigator 2.0.
But in Navigator 3.0, eval() can also be invoked through other objects:
var x = 1; o = new Object(); o.x = 2; o.eval('x'); // evaluated in o's context; returns 2 eval('x'); // evaluated in Window context; returns 1
eval() crashes Navigator 2.0 on 16-bit Windows (Windows 3.1) platforms. A workaround that is possible in some cases is to use Window.setTimeout() with a zero-millisecond delay as a replacement for eval().