7

I have been doing a lot JavaScript coding recently for front-end on IE8, and came across some issues that are caused by lacking of supporting functions from IE8.

Here are some functions:

 (1) indexOf() see discussion & solution
 (2) base64() See source
 (3) String.trim() See discussion & solution
 (4) history.pushstate See discussion & solution
 (5) map() See discussion & solution
 (6) ArrayBuffer  (7) bind  (8) Create  (9) DataView  (10) every  (11) filter ...

Please add more to this list if you came across any to help others.
Thanks

Community
  • 1
  • 1
Danyu
  • 509
  • 3
  • 7
  • I'm not sure if this is something that's on topic here. – gen_Eric May 08 '14 at 13:52
  • 4
    Just load this in and you'll have most ES5 functions in IE8: https://github.com/es-shims/es5-shim – gen_Eric May 08 '14 at 13:52
  • Unfortunately this is off topic. It shouldn't be though, but SE's official policy is all good "reference" type questions have already been asked, so there shouldn't be any more. – djechlin May 08 '14 at 13:56
  • 2
    Also, for a nice list of what works or not in IE 8 check out http://html5please.com/ and http://caniuse.com – gen_Eric May 08 '14 at 13:58
  • 1
    This question appears to be off-topic because it is about generating a list resource, rather than asking a specific question. – Matt May 08 '14 at 14:01
  • 1
    There you go: https://kangax.github.io/es5-compat-table/, https://kangax.github.io/es5-compat-table/non-standard/ – Felix Kling May 08 '14 at 14:01
  • 4
    [JavaScript Version Information](http://msdn.microsoft.com/en-us/library/s4esdbwz%28v=vs.94%29.aspx) at MSDN. – Teemu May 08 '14 at 14:04
  • @FelixKling: Thanks for those 2 links. I knew I had them in my bookmarks somewhere. – gen_Eric May 08 '14 at 14:05
  • @FelixKling: There's also http://kangax.github.io/es5-compat-table/es6/ ;) – gen_Eric May 08 '14 at 14:06
  • @Rocket: Yep, but I figured it's not relevant for IE8 :D It will be very handy though once adoption increases. Very excited about it :) – Felix Kling May 08 '14 at 14:07
  • 1
    @FelixKling: It's relevant to IE8 insomuch as nothing in it works in IE8! :D – gen_Eric May 08 '14 at 14:08
  • @Rocket: Fair enough :D – Felix Kling May 08 '14 at 14:08
  • 2
    [*ES5 Annex E*](http://ecma-international.org/ecma-262/5.1/#sec-E) lists all the features that are incompatible with ed. 3. There are many more items than in the lists linked to in other comments (e.g. enumerability of arguments items that correlate to formal parameters). – RobG May 08 '14 at 14:16

1 Answers1

0

Function.prototype.bind

Like

setTimeout(function(){
  this.someFunc() //
}.bind(window));
Konstantin Krass
  • 8,626
  • 1
  • 18
  • 24