HenrikJoreteg / emoji-images

replace stuff like :heart: with <img> tags of corresponding images per: http://www.emoji-cheat-sheet.com/
173 stars 29 forks source link

Does not work with IE8 #9

Closed JustBlackBird closed 10 years ago

JustBlackBird commented 10 years ago

IE8 and earlier does not have Array.prototype.indexOf method which is used here.

Is there any chance the compatibility will be added?

Mithgol commented 10 years ago

https://github.com/es-shims/es5-shim ?

JustBlackBird commented 10 years ago

@Mithgol, I do not think that using a big external library is better than fix a line of code.

ghost commented 10 years ago

fixing IE8 and earlier by replacing them with chrome/firefox would be easier than telling all js-libs out there to re-write maybe 20% of their code. Sorry, but I can't understand why Array.prototype.indexOf is called something that needs to be fixed here. He could replace it with lastIndexOf to provide support for firefox before 1.5 :laughing: But no hope for IE.

He'd need to add sth like this:

if (!Array.prototype.indexOf) {
  Array.prototype.indexOf = function (obj) {
    for (var i=0; i<this.length; i++) {
      if(this[i]==obj)
        return i;
      return -1;
    }
  }
}

But in my mind IE<=8 Users aren't worth such fixes, sorry. I'll not add sth like this in my similar project emoji-parser.

JustBlackBird commented 10 years ago

Ok, I've got the point. It seems that es5-shim is the only way to go.