P
P E Schoen
I've been playing with a simple HTML document which contains JavaScript in
the <HEAD>. It worked fine without proper DOCTYPE, but when I fixed that so
it validated, the JavaScript would not run. At first it was also broken in
Firefox but I changed the DOCTYPE slightly as recommended on one forum and
it worked - but still not in IE9.
There's also a somewhat puzzling complaint about a </P> that passed
validation in the first instance but not the second.
Here's my HTML:
http://www.enginuitysystems.com/ForceCalculator1.htm
I start as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" >
<TITLE>Force Calculator</TITLE>
<SCRIPT type="text/javascript"> //!-- Beginning of JavaScript -
And the complaint is here (around line 150):
<P>
<h2>Torque, Power, and RPM</h2>
<!-- </P> -->
I referred to the following, but I note that the SCRIPT in the header is an
external reference and the inline script is in the BODY. Maybe I'll try
that.
I haven't done anything with JavaScript (or HTML for that matter) for
awhile, so I'm quite rusty. This may be an obvious error but I'm stumped for
now.
Thanks!
Paul
www.muttleydog.com
the <HEAD>. It worked fine without proper DOCTYPE, but when I fixed that so
it validated, the JavaScript would not run. At first it was also broken in
Firefox but I changed the DOCTYPE slightly as recommended on one forum and
it worked - but still not in IE9.
There's also a somewhat puzzling complaint about a </P> that passed
validation in the first instance but not the second.
Here's my HTML:
http://www.enginuitysystems.com/ForceCalculator1.htm
I start as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" >
<TITLE>Force Calculator</TITLE>
<SCRIPT type="text/javascript"> //!-- Beginning of JavaScript -
And the complaint is here (around line 150):
<P>
<h2>Torque, Power, and RPM</h2>
<!-- </P> -->
I referred to the following, but I note that the SCRIPT in the header is an
external reference and the inline script is in the BODY. Maybe I'll try
that.
I haven't done anything with JavaScript (or HTML for that matter) for
awhile, so I'm quite rusty. This may be an obvious error but I'm stumped for
now.
Thanks!
Paul
www.muttleydog.com