Mikhus / canvas-gauges

HTML5 Canvas Gauge. Tiny implementation of highly configurable gauge using pure JavaScript and HTML5 canvas. No dependencies. Suitable for IoT devices because of minimum code base.
http://canvas-gauges.com/
MIT License
1.57k stars 396 forks source link

IE11 - "Object doesn't support property or method 'repeat'" #135

Open bmcleod opened 7 years ago

bmcleod commented 7 years ago

IE11 (at least for me), does not support the new ECMAScript 2015's "repeat" method. To fix this, I included Mozilla's poly-fill. Now everything's peachy.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat#Polyfill

michaelgeorgeau commented 7 years ago

Hi. I am getting this exact error in IE while it is working fine in Chrome and Firefox. Safari appears to have the same error too. Sorry to ask what is probably a basic question but how do I implement the fix above? Any help is greatly appreciated.

bmcleod commented 7 years ago

Copy the poly-fill code in the link I referenced and paste it in to a JS file that is referenced in your HTML. It could be the same JS file you write code for the canvas gauges in or a new file called poly-fill.js (as an example)

judian commented 6 years ago

Can someone add the polyfill function (for String.repeat), to file: lib/polyfill.js ?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat#Polyfill