How can I use the data URI in internet explorer as a URL?

后端 未结 2 1839
野的像风
野的像风 2021-01-20 00:43

The code I\'m trying to use is

data:text/html,


        
相关标签:
2条回答
  • 2021-01-20 00:59
    1. Data URIs: Internet Explorer does not support data URIs. Data URIs For security reasons, Data URIs are restricted to downloaded resources. Data URIs cannot be used for navigation, for scripting, or to populate frame or iframe elements.
    2. REM CSS: The CSS3 rem, which is always relative only to the root html element, is too new to rely on. As of July 2012, around 75% of all browsers in use support the rem.

    Reference Link:

    • Data URI scheme
    • Contenteditable
    • CSS3 Rem Attribute
    • Data URI Mozilla

    Conclusion: Please refer to the first link to achieve this as IE not started supporting it.

    • IE doesn't support Data URI tag. Hence you have to use it in javascript or in html tag.
    • IE doesn't support REM CSS3 Attribute rem as a unit. Hence you have to use em or px instead.
    0 讨论(0)
  • 2021-01-20 01:11

    You can try using the javascript engine to create a similar execution.


    From the URL bar:

    javascript:window.document.write('<body contenteditable style="font: 2em/1.5 monospace;max-width:60em;margin:0 auto;padding:4em;">');
    

    If you copy and paste you will need to manually type javascript: in front of it since the browser trims that part of on paste.


    If you want to execute a new window as an editor then try this:

    <script>
        function myFunction() {
            var myWindow = window.open("", "MyEditorWindow");
            myWindow.document.write("<body contenteditable style=\"font: 2em/1.5 monospace;padding:40px;\">");
    }
    </script>
    

    Check out this jsFiddle example

    0 讨论(0)
提交回复
热议问题