javascript - traceur conversion from ECMA6 to ECMA5 not working -


i followed tutorial in order learn how traceur compiler converts ecma6 ecma5.

following code.

<!doctype html> <html> <head>     <title>hello world!</title>      <script src="https://traceur-compiler.googlecode.com/git/bin/traceur.js"         type="text/javascript"></script>      <script src="https://traceur-compiler.googlecode.com/git/src/bootstrap.js"         type="text/javascript"></script>  </head> <body>      <h1 id="message">this content going change</h1>     <script type="text/traceur">       class greeter {         constructor(message) {           this.message = message;         }          greet() {           let element = document.queryselector('#message');           element.innerhtml = this.message;         }       };        let greeter = new greeter('helllllllo, world!');       greeter.greet();     </script>  </body> </html> 

but content in h1 tag not change when load page in firefox or chrome. issue ehre?

okay seems there problem script url. worked me after following different tutorial in github.

<!doctype html> <html> <head>     <title>hello world!</title>      <script src="https://google.github.io/traceur-compiler/bin/traceur.js"></script>     <script src="https://google.github.io/traceur-compiler/src/bootstrap.js"></script>  </head> <body>      <h1 id="message">this content going change</h1>     <script type="module">       class greeter {         constructor(message) {           this.message = message;         }          greet() {           let element = document.queryselector('#message');           element.innerhtml = this.message;         }       };        let greeter = new greeter('helllllllo, world!');       greeter.greet();     </script>  </body> </html> 

also worked <script type="text/traceur">


Comments