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:

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

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

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

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

No comments:

Post a Comment