Skip to content

Instantly share code, notes, and snippets.

@theRemix
Created May 25, 2014 01:09
Show Gist options
  • Save theRemix/3b9bcff991e99de2a70d to your computer and use it in GitHub Desktop.
Save theRemix/3b9bcff991e99de2a70d to your computer and use it in GitHub Desktop.
Test for js.JQuery.hx update
-main Test.hx
-js haxe.js
<!DOCTYPE html>
<html>
<head>
<title>Test JQuery on</title>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="haxe.js"></script>
</head>
<body>
<button class="added_after_domready">Test</button>
</body>
</html>
import js.Lib;
import js.JQuery;
import js.JQuery.JqEvent;
class Test
{
public function new()
{
new JQuery('body').on('click', 'button.added_after_domready', click_button);
}
private function click_button(e:JqEvent):Void
{
Lib.alert("clicked");
}
static public function main()
{
new JQuery('document').ready(function(e:JqEvent){
var app = new Test();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment