|
Posted by Toby A Inkster on 06/27/07 12:01
Andy Dingley wrote:
> There's stuff like this:
>> <script language="JavaScript" type="text/JavaScript">
>> <!--
>> function MM_reloadPage(init) { //reloads the window if Nav4 resized
>
> Now if I were interviewing for HTML coders, I'd ask them to identify at
> least 4 or 5 problems with just those few lines of code.
1. The language attribute is obsolete.
2. MIME types are typically written in all lowercase.
3. RFC 4329 says that "text/javascript" is an obsolete MIME type, however
the standards-compliant MIME type for Javascript isn't supported in
IE and many older browsers.
4. Comments around script haven't been necessary for well over a decade.
5. Comments around script are actually harmful if interpreted as XHTML.
6. This chunk of Javascript has been inserted entirely for the benefit of
Netscape 4, even though rest of page does not support it. So the script
as a whole is redundant.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 6 days, 15:29.]
The End of an Era
http://tobyinkster.co.uk/blog/2007/06/26/end-of-an-era/
Navigation:
[Reply to this message]
|