...

View Full Version : Structures like 'win95:"blabla",win98:"albalb"'



konst
03-23-2005, 09:12 AM
I've seen such a javascript constuction already not once, and I can't find any documentation on this feature.
The exact javascript code is e.g.:

var _q4W={win95:_XX("zlqgrzv#<83"),win98:_XX(" qvlw {(A@8"),winme:_XX("zlq<{#71<33"),win2000:_XX("{mrhs{w$rx$9244"),winxp:_XX("ykpfqyu\"pv\"7032"),winnet:_XX("xjoepxt!ou!6/31"),winnt:_XX("zlqgrzv#qw3"),linux:_XX("tqv}!8"),macosx:_XX("pdf#rv#{3"),macppc:_XX("rfh%>35")};

where _XX is a function defined earlier.
So the question is: is this any sense in such a constructions and (if yes ) how it should be used?
Should a javascript parser (which I'am developing) support such a syntax or it should generate errors (or maybe just ignore)?
Thank you for help

jkd
03-23-2005, 10:05 AM
http://www.byteshift.de/javascript-1415/CoreGuideJS15/ident.html#1009450

glenngv
03-23-2005, 10:10 AM
That is called object literal. Read these links to get more info on this.

http://javascriptkit.com/javatutors/oopjs.shtml
http://www.moztips.com/index.php


jkd beat me to it. :o



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum