Our server costs ~$56 per month to run. Please consider donating or becoming a Patron to help keep the site running. Help us gain new members by following us on Twitter and liking our page on Facebook!
Current time: April 23, 2024, 9:09 am

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using BabelJS
#1
Using BabelJS
So, I recently learned about BabelJS, and it looks like an interesting technology. It seemed to me it could be used to make my web-app ( https://flatassembler.github.io/PicoBlaz...Blaze.html ) work in Internet Explorer 11. It does not work in Internet Explorer 11, but it is not exceptionally modern JavaScript, that is, it works in Firefox 52 (the last version of Firefox to run on Windows XP). So, here is what I tried. In the head, I added this ( https://github.com/FlatAssembler/PicoBla....html#L387 ):
Code:
   <script id="objectAssignPolyfill"></script>
   <script id="symbolPolyfill"></script>
   <script id="fetchPolyfill"></script>
   <script id="BabelJS"></script>
   <script id="BabelPolyfill"></script>

Now, in the body, I have a message that shows in case JavaScript fails to execute. So, into that message, I added the following code ( https://github.com/FlatAssembler/PicoBla...html#L1111 ):

PHP Code:
         Oryou can try
 
         <a href="javascript:void(0)" onclick="downloadBabel()"
 
           >polyfilling your browser with BabelJS</a
          
>.
 
       </div>
 
     </div>
 
     <script>
 
       function downloadBabel() {
 
         document.getElementById("objectAssignPolyfill").src =
 
           "https://cdn.jsdelivr.net/npm/object-assign-polyfill/index.min.js";
 
         document.getElementById("symbolPolyfill").src =
 
           "https://cdn.jsdelivr.net/npm/symbol-es6/symbol-es6.min.js";
 
         document.getElementById("BabelPolyfill").src =
 
           "https://unpkg.com/@babel/polyfill/dist/polyfill.js";
 
         /*
           Do not include the minified file, because Babel Minifier
           transpiles "RegExp('x','y')" into "/x/y", which is a syntax
           error in Internet Explorer 11!
      */
 
         document.getElementById("BabelJS").src =
 
           "https://unpkg.com/@babel/standalone/babel.min.js";
 
         document.getElementById("fetchPolyfill").src =
 
           "https://cdn.jsdelivr.net/npm/[email protected]/dist/fetch.umd.min.js";
 
         var scripts document.getElementsByTagName("script");
 
         for (var 0scripts.lengthi++) {
 
           if (scripts[i].type == "text/javascript") {
 
             var newScriptTag document.createElement("script");
 
             newScriptTag.type "text/babel";
 
             newScriptTag.src scripts[i].src;
 
             newScriptTag.setAttribute("async"false);
 
             newScriptTag.innerHTML scripts[i].innerHTML;
 
             document.body.appendChild(newScriptTag);
 
           }
 
         }
 
       }
 
     </script
However, it still does not work in Internet Explorer 11. What else is there to try? It is unfortunate that many people, including relatively tech-savvy ones, still use such ancient browsers, and it would be good if at least some functionality of my web-app were available in them.
Reply



Messages In This Thread
Using BabelJS - by FlatAssembler - May 14, 2021 at 5:20 pm
RE: Using BabelJS - by BrianSoddingBoru4 - May 14, 2021 at 5:53 pm
RE: Using BabelJS - by arewethereyet - May 14, 2021 at 5:58 pm
RE: Using BabelJS - by BrianSoddingBoru4 - May 14, 2021 at 6:08 pm
RE: Using BabelJS - by arewethereyet - May 14, 2021 at 6:23 pm
RE: Using BabelJS - by Abaddon_ire - May 14, 2021 at 5:59 pm
RE: Using BabelJS - by arewethereyet - May 14, 2021 at 6:23 pm
RE: Using BabelJS - by Abaddon_ire - May 14, 2021 at 6:48 pm
RE: Using BabelJS - by arewethereyet - May 14, 2021 at 6:55 pm
RE: Using BabelJS - by Abaddon_ire - May 14, 2021 at 7:12 pm
RE: Using BabelJS - by arewethereyet - May 14, 2021 at 7:15 pm
RE: Using BabelJS - by Abaddon_ire - May 14, 2021 at 7:50 pm

Possibly Related Threads...
Thread Author Replies Views Last Post
  Using drones to watch on crime? Fake Messiah 32 2581 September 17, 2019 at 8:32 am
Last Post: EgoDeath
  Using SSDs for dual boot systems emjay 9 1428 November 8, 2016 at 7:33 pm
Last Post: emjay
  What OS are you using? account_inactive 89 7101 September 26, 2016 at 3:57 pm
Last Post: account_inactive
  Nothing annoys me quite like linux and using OSS tools KevinM1 12 2070 January 24, 2015 at 12:59 am
Last Post: KevinM1



Users browsing this thread: 1 Guest(s)