469,568 Members | 1,430 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

; Expected error message

9
The following script will validate. It is supposed to convert from one temp scale to another. I am getting the following error " line 15 ";" expected.

I cannot find this error. Please give me a hint
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Temperature Conversion</title>

<script type="text/javascript">
//<![CDATA[
<!-- HIDE FROM INCOMPATIBLE BROWSERS
var fahrenheit = new Array();
var celcius = 0;
for (var i = 0; i <= 100; ++i) {
fahrenheit[i] = i;
}
for (var j=0, j<=100, ++j) {
celcius = (fahrenheit[i] - 32) * .55;
document.write(fahrenheit[i] + " degrees Fahrenheit is equal to "
+ "celcius" + Celsius.<br />");
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
//]]>
</script>
</head>
<body>
</body>
</html>
Nov 23 '06 #1
3 1728
vee10
141 100+
hi,

check whether u have place ; in the
for (var j=0, j<=100, ++j)
otherwise
this is urs
document.write(fahrenheit[i] + " degrees Fahrenheit is equal to "
+ "celcius" + Celsius.<br />");
place this
document.write(fahrenheit[i] + " degrees Fahrenheit is equal to "
+ "celcius" + celsius.+"<br />");




The following script will validate. It is supposed to convert from one temp scale to another. I am getting the following error " line 15 ";" expected.

I cannot find this error. Please give me a hint
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Temperature Conversion</title>

<script type="text/javascript">
//<![CDATA[
<!-- HIDE FROM INCOMPATIBLE BROWSERS
var fahrenheit = new Array();
var celcius = 0;
for (var i = 0; i <= 100; ++i) {
fahrenheit[i] = i;
}
for (var j=0, j<=100, ++j) {
celcius = (fahrenheit[i] - 32) * .55;
document.write(fahrenheit[i] + " degrees Fahrenheit is equal to "
+ "celcius" + Celsius.<br />");
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
//]]>
</script>
</head>
<body>
</body>
</html>
Nov 23 '06 #2
511475
9
Thank you for your help. I made the following changes.<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Temperature Conversion</title>

<script type="text/javascript">
//<![CDATA[
<!-- HIDE FROM INCOMPATIBLE BROWSERS
var fahrenheit = new Array();
var celcius = 0;
for (var i = 0; i <= 100; ++i) {
fahrenheit[i] = i;
}
for (var j=0, j<=100, ++j); {
celcius = (fahrenheit[i] - 32) * .55;
document.write(fahrenheit[i] + " degrees Fahrenheit is equal to "
+ "celcius" + celsius.+"<br />");
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
//]]>
</script>
</head>
<body>
</body>
</html>
I still get the error "exected; at line 15.

This is line 14 and line 15

fahrenheit[i] = i;
}

puzzled
Nov 23 '06 #3
Line 15 is apparently one after what you think. On that line you had:
for (var j=0, j<=100, ++j) {
you changed it to:
for (var j=0, j<=100, ++j); {
It should be
for (var j=0; j<=100;++j) {
Nov 27 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Bill | last post: by
5 posts views Thread by andy.herrera | last post: by
4 posts views Thread by pei_world | last post: by
3 posts views Thread by Jon | last post: by
4 posts views Thread by Kiyomi | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.