Data URI to Object URL with createObjectURL in chrome/ff

后端 未结 3 1367
栀梦
栀梦 2021-01-03 02:55

I have base64 string of an image. How can I convert this to Object URL? The purpose is to try and see if my svg-editor will be faster, by injecting Blob URL to the DOM inste

3条回答
  •  -上瘾入骨i
    2021-01-03 03:42

    What happens if you want to show html in an iframe?

    iframe.src = "data:text/html,"+encodeURIComponent( window.btoa(text) );
    

提交回复
热议问题