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
7
  • How do you render that SVG? Why don't you just do <img src="app/img/something-svg"/> ? Commented Dec 19, 2018 at 7:33
  • 1
    IE 11 cannot create SVG elements with innerHTML. You'd need to use some other mechanism if you want to support IE. Commented Dec 19, 2018 at 7: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. Commented Dec 19, 2018 at 7: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. caniuse.com/#feat=xml-serializer Says tha IE 11 support this. Commented Dec 19, 2018 at 7: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. Commented Dec 20, 2018 at 6:15

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.