Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Timeline - IE11 - 'createStyleSheet' unsuported #336

Open
ova2 opened this issue Feb 11, 2015 · 2 comments
Open

Timeline - IE11 - 'createStyleSheet' unsuported #336

ova2 opened this issue Feb 11, 2015 · 2 comments

Comments

@ova2
Copy link
Contributor

ova2 commented Feb 11, 2015

IE 11 throws:
SCRIPT438: Object doesn't support property or method 'createStyleSheet'

when I want to show timeline. In "emulation mode" or older versions of IE it works.

@josdejong
Copy link
Contributor

Are u sure this error originates from the Timeline? In the source code(https://github.com/almende/chap-links-library/blob/master/js/src/timeline/timeline.js) of the Timeline there is no mention at all of createStyleSheet.

This can originate from using the excanvas.js script, for adding canvas support on IE8 and older. The Graph of chap-links-library uses canvas, hence you may have added the excanvas.js script for that?

Anyway, looking at the IE docs of createStyleSheet, they have dropped support for it in IE11 (it was an IE only thing anyway). Solutions:

  • If you just use the Timeline you don't need excanvas.js at all.

  • Fix the excanvas.js script (replace createStyleSheet with createElement('script')).

  • Load a polyfill for this before loading excanvas.js in the browser:

    if  (typeof document.createStyleSheet === 'undefined') {
      document.createStyleSheet = function () {
        return document.createElement('script');
      }
    }

@ova2
Copy link
Contributor Author

ova2 commented Feb 12, 2015

Thanks. I think we use excanvas.js.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants