Can someone tell me why this script will only work on a Mac with Internet
Explorer.
Thanks,
Ed
<html>
<head>
<script type="text/javascript">
//Square Root
function squareroot()
{
var x=document.form s('root')
var data=x.elements['num'].value;
var sqr=Math.sqrt(d ata)
frames['sqrt'].document.write (sqr)
}
//Squared of an item
function squared()
{
var x=document.form s('square')
var data=x.elements['num2'].value;
var sum=data*data
frames['squaredframe'].document.write (sum)
}
//Tanget
function tangent()
{
var x=document.form s('tangent')
var data=x.elements['num3'].value;
var tan=Math.tan(da ta)
frames['tangentframe'].document.write (tan)
}
//Refresh Values
function refresh()
{
location.reload (sqrt)
location.reload (squaredframe)
location.reload (tangentframe)
}
</script>
</head>
<body>
<table width="100%" border="1">
<tr>
<td width="73%" height="50">
<form name="root">
Type in a number to compute the square root of the value.
<input name="num" type="text" id="num" size="10" maxlength="10">
<input name="button" type="button" onClick="square root()"
value="Compute" >
</form></td>
<td width="27%" height="50"><if rame name="sqrt" width="100%" height="50"
frameborder="0" scrolling="no"> </iframe></td>
</tr>
<tr>
<td height="50">
<form name="square">
Type in a number to compute the square of the value.
<input name="num2" type="text" id="num2" size="10" maxlength="10">
<input name="button2" type="button" onClick="square d()"
value="Compute" >
</form></td>
<td><iframe name="squaredfr ame" width="100%" height="50" frameborder="0"
scrolling="no"> </iframe></td>
</tr>
<tr>
<td height="50">
<form name="tangent">
Type in a number to compute the tanget of the value.
<input name="num3" type="text" id="num3" size="10" maxlength="10">
<input name="button3" type="button" onClick="tangen t()"
value="Compute" >
</form></td>
<td><iframe name="tangentfr ame" width="100%" height="50" frameborder="0"
scrolling="no"> </iframe></td>
</tr>
</table>
<div align="right">
<form name="refresh">
Hit refresh to compute new values.
<input type="button" onClick="refres h()" value="Refresh Values">
</form>
</div>
</body>
</html>
Explorer.
Thanks,
Ed
<html>
<head>
<script type="text/javascript">
//Square Root
function squareroot()
{
var x=document.form s('root')
var data=x.elements['num'].value;
var sqr=Math.sqrt(d ata)
frames['sqrt'].document.write (sqr)
}
//Squared of an item
function squared()
{
var x=document.form s('square')
var data=x.elements['num2'].value;
var sum=data*data
frames['squaredframe'].document.write (sum)
}
//Tanget
function tangent()
{
var x=document.form s('tangent')
var data=x.elements['num3'].value;
var tan=Math.tan(da ta)
frames['tangentframe'].document.write (tan)
}
//Refresh Values
function refresh()
{
location.reload (sqrt)
location.reload (squaredframe)
location.reload (tangentframe)
}
</script>
</head>
<body>
<table width="100%" border="1">
<tr>
<td width="73%" height="50">
<form name="root">
Type in a number to compute the square root of the value.
<input name="num" type="text" id="num" size="10" maxlength="10">
<input name="button" type="button" onClick="square root()"
value="Compute" >
</form></td>
<td width="27%" height="50"><if rame name="sqrt" width="100%" height="50"
frameborder="0" scrolling="no"> </iframe></td>
</tr>
<tr>
<td height="50">
<form name="square">
Type in a number to compute the square of the value.
<input name="num2" type="text" id="num2" size="10" maxlength="10">
<input name="button2" type="button" onClick="square d()"
value="Compute" >
</form></td>
<td><iframe name="squaredfr ame" width="100%" height="50" frameborder="0"
scrolling="no"> </iframe></td>
</tr>
<tr>
<td height="50">
<form name="tangent">
Type in a number to compute the tanget of the value.
<input name="num3" type="text" id="num3" size="10" maxlength="10">
<input name="button3" type="button" onClick="tangen t()"
value="Compute" >
</form></td>
<td><iframe name="tangentfr ame" width="100%" height="50" frameborder="0"
scrolling="no"> </iframe></td>
</tr>
</table>
<div align="right">
<form name="refresh">
Hit refresh to compute new values.
<input type="button" onClick="refres h()" value="Refresh Values">
</form>
</div>
</body>
</html>
Comment