Microsoft JScript运行时错误:“计算器"未定义 [英] Microsoft JScript runtime error: 'Calculator' is undefined

查看:64
本文介绍了Microsoft JScript运行时错误:“计算器"未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<td>
<input type="button" name="one"   value="  1  " onclick="Calculator.Input.value += '1'"/>
<input type="button" name="two"   value="  2  " onclick="Calculator.Input.value += '2'"/>
<input type="button" name="three" value="  3  " onclick="Calculator.Input.value += '3'"/>
<input type="button" name="plus"  value="  +  " onclick="Calculator.Input.value += ' + '"/>
<br/>
<input type="button" name="four"  value="  4  " onclick="Calculator.Input.value += '4'"/>
<input type="button" name="five"  value="  5  " onclick="Calculator.Input.value += '5'"/>
<input type="button" name="six"   value="  6  " onclick="Calculator.Input.value += '6'"/>
<input type="button" name="minus" value="  -  " onclick="Calculator.Input.value += ' - '"/>
<br/>
<input type="button" name="seven" value="  7  " onclick="Calculator.Input.value += '7'"/>
<input type="button" name="eight" value="  8  " onclick="Calculator.Input.value += '8'"/>
<input type="button" name="nine"  value="  9  " onclick="Calculator.Input.value += '9'"/>
<input type="button" name="times" value="  x  " onclick="Calculator.Input.value += ' * '"/>
<br/>
<input type="button" name="clear" value="  c  " onclick="Calculator.Input.value = ''"/>
<input type="button" name="zero"  value="  0  " onclick="Calculator.Input.value += '0'"/>
<input type="button" name="DoIt"  value="  =  " onclick="Calculator.Input.value = eval(Calc.Input.value)"/>
<input type="button" name="div"   value="  /  " onclick="Calculator.Input.value += ' / '"/>
<br/>
</td>
</tr>
</table>

推荐答案

我相信您正在尝试根据以下示例对应用程序进行模式化:

http://sumtotalz.com/TotalAppsWorks/Javascript/JS_BasicCalc.html [
I believe you are trying to pattern an application off of this example:

http://sumtotalz.com/TotalAppsWorks/Javascript/JS_BasicCalc.html[^]

Notice that in the example, the author says Calc.Input.value. The "Calc" refers to the name of the Form. So, in your application, you would need to make sure you named your form "Calculator" like so:

<FORM NAME="Calculator">


这篇关于Microsoft JScript运行时错误:“计算器"未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆