ivmartel / dwv

DICOM Web Viewer: open source zero footprint medical image library.
https://ivmartel.github.io/dwv/
GNU General Public License v3.0
1.64k stars 588 forks source link

IE11 TypeError: Object doesn't support property or method 'slice' #303

Closed daurenmuratov closed 7 years ago

daurenmuratov commented 7 years ago

I'm run sample project in ie: ... dwv.gui.setup(); var app = new dwv.App(); app.init({ "containerDivId": "dwv", "fitToWindow": true, "gui": ["tool", "version", "tags"], "tools": ["Scroll", "WindowLevel", "Draw"], "shapes": ["Arrow", "Line", "Protractor", "Rectangle", "Roi", "Ellipse"] }); app.loadURLs([ "https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323851.dcm", "https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323707.dcm", "https://raw.githubusercontent.com/ivmartel/dwv/master/tests/data/bbmri-53323563.dcm" ]);

TypeError: Object doesn't support property or method 'slice'. Other browsers run successful.

ivmartel commented 7 years ago

For IE11 and browsers that do not provide the slice method, you need to call the dwv.browser.check() function (added for #275). As its name does not suggest, this function provides default implementations for these browsers.

yuliacech commented 7 years ago

Hi there,

I had the same problem in IE 11 and found that, if you use dwv as an external resource and don't want to/can't call the function dwv.browser.check(), then you can load polyfill in your browser directly. I use one from babel: run "npm install babel-polyfill --save-dev" in your project and either load the file "node_modules/babel-polyfill/dist/polyfill.js" with a script tag or add this file to your bundle compilation.

Hope that helps!

Best, Yulia