title: Haxe JavaScript HTML form
body: <p>In the "Try Haxe" (<a href="http://try.haxe.org" rel="nofollow noreferrer">http://try.haxe.org</a>) site, the default sample test code is as follows:</p>
  
  <pre><code>class Test {
    static function main(){
      #if js
      new js.JQuery("body").html("Haxe is great :)");
      #elseif flash
      trace("Haxe is great :)");
      #end
    }
  }
  </code></pre>
  
  <p>Running it on that page is quite straight-forward (can choose "Options" and target either "JS" or "SWF") and the output is the following for "SWF":</p>
  
  <blockquote>
    <p>Test.hx:6: Haxe is great :)</p>
  </blockquote>
  
  <p>and the output is the following for "JS":</p>
  
  <blockquote>
    <p>Haxe is great :)</p>
  </blockquote>
  
  <p>The part that confuses me is the javascript part because when I compile the source code myself on my laptop, the resulting <code>test.js</code> file is very complex and looks nothing like the "JS Source" that is displayed on that page:</p>
  
  <pre><code>(function () { "use strict";
  var Test = function() { };
  Test.main = function() {
      new js.JQuery("body").html("Haxe is great :)");
  };
  var js = {};
  var q = window.jQuery;
  js.JQuery = q;
  Test.main();
  })();
  </code></pre>
  
  <p>Should I change the contents of the Haxe-compiled <code>test.js</code> to the above? Also, I don't know how the actual <code>index.html</code> page should look like in order to display the results of the JavaScript output "Haxe is great  :)". Any tips on what the actual code for the <code>index.html</code> page for the JavaScript example output would be appreciated.</p>