1

I am using SVG.js. So I get ready SVG file, I catch div with document.getElementById and I make innerHTML. I had an error but when I used Angular sanitizer error is now not displaying (It was 'access denied'). Everything is working fine on Edge/Chrome except IE 11. I used Angular's polyfills - I uncommented things from polyfills.ts and used npm install in same cases where it is required. I don't know why it is not working.

  1. I found informations that IE need viebox - I checked and it is inside my SVG. topic here
  2. I tried to not innerHTML directly - so I make new div with id and I append it into my empty (always existing) div. Still not working. topic here
Mieszczańczyk S.
  • 857
  • 1
  • 9
  • 16
  • How do you render that SVG? Why don't you just do `` ? – Jacopo Sciampi Dec 19 '18 at 07:33
  • 1
    IE 11 cannot create SVG elements with innerHTML. You'd need to use some other mechanism if you want to support IE. – Robert Longson Dec 19 '18 at 07:41
  • @JacopoSciampi I get from my API svg file in base64 and I inner it into empty div with specified ID (as I write in question). It is not working correctly only in IE. – Mieszczańczyk S. Dec 19 '18 at 07:54
  • @RobertLongson do you know how to do it in another way? I wthought I can do it when I use Angulars method sanitize() even with SecurityContext.NONE. https://caniuse.com/#feat=xml-serializer Says tha IE 11 support this. – Mieszczańczyk S. Dec 19 '18 at 07:54
  • When using IE browser, is there any error (try to use F12 developer tool to check it)? Can you post the Enough code to reproduce the problem as in [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – Zhi Lv Dec 20 '18 at 06:15
  • Yes, I have 'Access Denied: Symbol()_g.v6bal5hv84a: undefined, Symbol()_h.v6bal5hv84a: undefined, Symbol(rxSubscriber)_i.v6bal5hv84a: undefined' – Mieszczańczyk S. Dec 21 '18 at 07:28
  • I tried to add this but still not working. https://www.npmjs.com/package/isomorphic-fetch – Mieszczańczyk S. Dec 21 '18 at 07:39

0 Answers0