Shortest syntax for preloading images in Javascript (in answer to a question by Wouterd yesterday):
for(i in ['larry.gif','moe.gif',
'curly.gif'])(new Image()).src=M[i];
Interaction design • webdevelopment • web art • photography
Shortest syntax for preloading images in Javascript (in answer to a question by Wouterd yesterday):
for(i in ['larry.gif','moe.gif',
'curly.gif'])(new Image()).src=M[i];
for(i in M=['larry.gif','moe.gif','curly.gif'])(new Image()).src=M[i];
[] replaces the new Array constructor...
cool stuff, man!