Haxe Code Cookbook
Haxe programming cookbookJavaScript


Overview of Haxe javascript snippets and tutorials.

  • Jan 23, 2018 JavaScript /

     javascript dom html

    This is an example to add a paragraph element to the HTML page when the DOM is ready. This tutorial contains two methodes; with and without jQuery.

  • Jan 23, 2018 JavaScript /

     javascript nodejs server

    The following tutorial creates a http server using Haxe/Node.js at port 8000 and demonstrates how to build and run it.

  • Jan 23, 2018 JavaScript /

     javascript workers multi-threading

    JavaScript workers make it possible to perform costly calculations (media decoding etc, crypt calculations etc.) in a background thread, without blocking the main UI. There are lots of articles about workers on the net:

  • Jan 23, 2018 JavaScript /

     javascript dead-code-elimination libraries

    Normally, when compiling Haxe to JavaScript, the resulting code is kept away from the global scope. This means that you can't reach the Haxe generated code from other scripts. To make that possible, there's the @:expose metadata that can be used on a class. This makes the class exposed to the global scope, and therefore possible to use in plain JavaScript.