...

View Full Version : </script> tag won't validate (!!)



mknz
06-07-2007, 11:19 AM
Hello,

I'm a newbie (to this forum - and to javascript). I've just finished my portfolio website and am trying to validate it @ http://www.w3schools.com/site/site_validate.asp but it keeps coming up with the error:

Error Line 20 column 8: end tag for element "script" which is not open.
</script>
The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

Does anyone know how I can fix this please? Without me having to do external styles or scrapping the script altogether. (Please view source on my index.html file for code).

Here's my website address: http://www.superkooge.com/

Any help greatly appreciated. Cheers! :D

Bill Posters
06-07-2007, 11:39 AM
superkooge.com/index.html: lines 8-20

<script src="AC_OETags.js" type="text/javascript"></script>
<!--
//
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
//
// -->
</script>

You've closed the script element on the same line that you open it.
The later closing </script> tag relates to no opening <script> tag - hence the error.

You can't embed js within a srced script element.
If you want to use both external and embedded js, you'll need to use two script elements.


<script src="AC_OETags.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
//
// Globals
// Major version of Flash required
var requiredMajorVersion = 8;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 0;
//
// -->
</script>

Be certain to look more closely at the text of the errors, and particular the code on the lines where the errors are reported to appear.

mknz
06-07-2007, 12:39 PM
Awesome thankyou so much. It works perfectly now. My apologies, that was a complete oversight. I should've noticed that.

Thanks again.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum