When the value Error
is already in the input, this line:
form.display.value = eval(form.display.value);
...is going to evaluate to the function Error
you defined earlier. So this must be happening on a second call to your compute
function.
Note that browsers are inconsistent with how eval
works, which is why you see browser differences.