Skip to content

Instantly share code, notes, and snippets.

@frasten
Created January 30, 2011 23:47
Show Gist options
  • Save frasten/803433 to your computer and use it in GitHub Desktop.
Save frasten/803433 to your computer and use it in GitHub Desktop.
IE, getElementById, gli id e le variabili omonime
<html>
<head>
</head>
<body>
<div id="mario"></div>
<script type="text/javascript">
// Questo da errore
mario = 1;
// Questo invece no!
// var mario = 1;
/*
Motivazione: nel primo caso IE, essendo notoriamente scemo, tenta
di assegnare all'oggetto con id 'mario' il valore 1.
Ha questo una spiegazione scientifica? Ovviamente no.
Deve la gente continuare ad usare IE? Ovviamente no.
Continua la gente ad usare IE? Ovviamente si'.
*/
</script>
</body>
</html>
@frasten
Copy link
Author

frasten commented Jan 31, 2011

@PicciMario
Copy link

concordo...

@frasten
Copy link
Author

frasten commented Mar 1, 2011

@PicciMario: ahahah!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment