Reply to Re: Why this code is invalid? [+stupid=mozilla :P ]

Your name:

Reply:


Posted by Jonathan N. Little on 01/13/03 11:29

talthen.z-serwera.o2@nospam.pl wrote:
> "Arne" <invalid@domain.invalid>
>
>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
>> "http://www.w3.org/TR/html4/frameset.dtd">
>>
>>to make the pages rendered in standard mode, not quirks mode :)
>
>
> Well... without DOCTYPE pages are smaller :P Also px in width, type in
> <script and <title are things that, when ommitted make the page smaller :]
> Even Mozilla can render such pages, however I don't understand why MSIE and
> Opera can understand this:
> document.forms[0].goto.value=x;
> and Mozilla can't. W3C validator also doesn't make errors on it. Stupid
> mozilla- I lost few hours to find this out :P

No your problem is 'goto' is a JavaScript reserve word!!!

JavaScript Reserve Words:

abstract, boolean, break, byte, case, catch, char, class, const,
continue, debugger, default, delete, do, double, else, enum, export,
extends, false, final, finally, float, for, function, goto, if,
implements, import, in, instanceof, int, interface, long, native, new,
null, package, private, protected, public, return, short, static, super,
switch, synchronized, this, throw, throws, transient, true, try, typeof,
var, void, volatile, while, with

Change the name and it works just fine, Mozilla is just being smart
enough to know that you made an error:


<script type="text/javascript">
function proof(){
var x="Some value";
document.forms[0].notgoto.value=x;
}
</script>
<form>
<input name="notgoto" type="text">
<input type="button" onclick="proof()" value="Works">
</form>


Try for yourself ;-)


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация