unit-js.html 1.1 KB

12345678910111213141516171819202122232425262728
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Haxe Tests (JS)</title>
  6. <meta name="description" content="">
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. </head>
  9. <body id="haxe:trace">
  10. <script type="text/javascript" src="//code.jquery.com/jquery-3.3.1.min.js"></script>
  11. <script type="text/javascript">
  12. // http://stackoverflow.com/questions/11582512/how-to-get-url-parameters-with-javascript
  13. function getURLParameter(name) {
  14. return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null
  15. }
  16. $.ajax({
  17. url: getURLParameter("js") || "bin/unit.js",
  18. dataType: "script",
  19. success: function() {
  20. unit.TestMain.main();
  21. },
  22. error: function(jqXHR, textStatus, errorThrown) {
  23. throw errorThrown;
  24. }
  25. });
  26. </script>
  27. </body>
  28. </html>