Is there a java script compiler?

L

lex parker

I thought java script was included with the package. Yet
when I run a program it gives me "error on page" message.
The source code was verified syntactically correct through
validator.w3.org website. I will enclose the source code.
It's copied verbatim from a college text book.


<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">


<html xmlns= "http://www.w3.org/1999/xhtml">

<head>
<title>Calculating Sphere Volumes</title>


<script type = "text/javascript">

<!--


function displayVolume()
{
var radius = parseFloat(
myform.radiusField.value );
window.status = "Sphere volume is " +
sphereVolume( radius );
}




function sphereVolume( r )
{
return (4.0 / 3.0) * math.PI * math.pow( r,
3 );
}


// -->
</script>


</head>


<body>
<form name = "myform" action = "">
Enter the radius of a sphere<br />
<input name = "radiusField" type = "text" />
<input name = "calculate" type = "button"
value = "Calculate" onclick
= "displayVolume()" />
</form>

<p>
<a
href="http://validator.w3.org/check/referer"><img
src="http://www.w3.org/Icons/valid-xhtml10"
alt="Valid XHTML 1.0!" height="31"
width="88" /></a>
</p>

</body>
</html>
 
L

lordmorgul

The problem seems to be the xhtml, not the java. I'm
having similar issues with rendering in IE
6.0.2800.1106.xpsp2.030422-1633.

It will render the file if local, but will not if pulled
off my server (instead it displays the source). This
happens with similar validated xhtml with and without
javascript. The file renders in IE6 very similarly to
MozillaFirebird 0.6.1+ and Opera 7.11 when viewing the
file from a local disk source.

So far no adjustment of IE's options or security settings
has any positive effect on this behavior. It is
consistent with all xhtml doc-types.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top