When I use JQueryExtern, jquery.min.xxx.js will be included automatically?

32 views
Skip to first unread message

Steve Jeon

unread,
Jul 24, 2014, 5:33:36 AM7/24/14
to haxe...@googlegroups.com
Hi, guys

Just curious...
When I use JqueryExtern, any relevant version of jquery api will be included to exported  js file automatically?
or any option to do it. Do I have to include like below?

<body>
<script src="HaxeJSTest.js"></script>
</body>  in the index.html each time?

I tried in flashdevelop, it seems not including automatically. 

Besides, I wonder I can keep ask simple questions like this in this google groups, 
or is there any right place (or bbs, blog) to ask for a beginner?

Best, 
Steve

Andy Li

unread,
Jul 24, 2014, 5:44:59 AM7/24/14
to haxe...@googlegroups.com
Hi,

As explained in the README file, jQuery is not automatically embedded. It is up to you on how to load it. What you've mentioned using script tag will be fine.
You may also get it embedded in the compiled JS using Compiler.includeFile e.g. --macro includeFile("path/to/jquery-latest.min.js")

For asking question, generally it is fine to use this list. Or you may post it to StackOverlow with a haxe tag, which there are quite a lot of experienced haxe users :)

Best,
Andy


--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Skial Bainn

unread,
Jul 24, 2014, 5:53:29 AM7/24/14
to haxe...@googlegroups.com
With jQueryExtern you have to manually include jQuery into your HTML. 

If you want your local jQuery file to be merged with the Haxe generated javascript, I think I remember you can add the following to your hxml file :

--macro haxe.macro.Compiler.includeFile("path/to/jQuery.js")


--

Steve Jeon

unread,
Jul 24, 2014, 6:09:18 AM7/24/14
to haxe...@googlegroups.com
Oh, my bad, 

I missed 
"Remember jQueryExtern is simply an extern, you have to link jQuery in your html file.".
And thank you for the tip.
Reply all
Reply to author
Forward
0 new messages