Friday 8 March 2013

IE points to what?

Ever ran into an IE issue when doing some sweet JavaScript? Me too. But here's something that might be new - at least it was for me! Pay attention to PonyName and ponyName:

<html><body>
 <input type="hidden" name="PonyName" id="NameKeeper" />

 <script>
  "use strict";
  function neigh(ponyName) {
   "use strict";
   alert("Greetings, " + PonyName + "!\n\nHerd, please welcome " + ponyName + "!");
  }
 </script>
 <input type="button" value="Neigh!" onclick="neigh('Rarity');" />
</body></html>

Chrome: As expected.
IE                     .
Wat R U Doin ?
IE                     .
Stahp               !

Strict mode might help here, but IE9... you know.