I have finished making my Website for a piece of Uni coursework.
It had to be XHTML compliant which it is, so it was all good.
Until our Teacher asked us to put in a bit of code to show when each page was last modified in order to stop us handing it in, then modifing it to gain a better mark.
The code is this...
<script language="Javascript">document.write(document.lastModified)</script>
It shows the last modified date, cool, but when I validate it to test if its XHTML compliant I get...The error message is all in yellow and the bit it highlights in the error message is in red...
Error : Line 97 column 32: required attribute "type" not specified.
<script language="Javascript">document.write(document.lastModified)</script>
The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.
Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>
I thought the "type" was specified here...
<script language="Javascript">
Please help me, its due in on Wednesday.
Thanks for your time, Steve.
It had to be XHTML compliant which it is, so it was all good.
Until our Teacher asked us to put in a bit of code to show when each page was last modified in order to stop us handing it in, then modifing it to gain a better mark.
The code is this...
<script language="Javascript">document.write(document.lastModified)</script>
It shows the last modified date, cool, but when I validate it to test if its XHTML compliant I get...The error message is all in yellow and the bit it highlights in the error message is in red...
Error : Line 97 column 32: required attribute "type" not specified.
<script language="Javascript">document.write(document.lastModified)</script>
The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.
Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>
I thought the "type" was specified here...
<script language="Javascript">
Please help me, its due in on Wednesday.
Thanks for your time, Steve.
Last edited: