LoginSignup
1

More than 5 years have passed since last update.

haxeの中に生のjsを書く。

Last updated at Posted at 2015-10-24

untyped __js__をつかって以下のように書けば良い。
複数行のstringも大丈夫なので、以下のような感じに書ける。

jsinhaxe.hx

var hoge:Int = 0;
var fuga:String = "";
untyped __js__("
 hoge=10+10;
 fuga =  'test ' +hoge;
");

trace(hoge); //20
trace(fuga); //test 20

ここで試せる!
http://try.haxe.org/#2Ff76

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1