--
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.
Thanks, but If you look on my code you'll see that I turn in onData event... This should do the work.. No?
--
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.
Thanks,
> What is wrong in your code is the for (btn in menu) loop: the onclick closures you create in the loop will all share the same btn variable (and value) which is defined/hoisted outside the loop. In short, all the buttons will use > the last btn's href.
"btn.onclick" in "for (btn in menu) " 0_0 or that I missed something...
> Ah sorry for the problem initRegisterPage it looks correct. Random guess: is "registerSumbit" a typo for "registerSubmit"? Or maybe you have several "registerSumbit" elements?Also 'URLReq.onError("Can't load index");' immediately executes .onError - that's probably not the desired effect.
Amm... no.. I think my code is right... I think it's something with the browser: if I put a break point before the "initRegisterPage() " it work fine, if I put the breakpoint after the "initRegisterPage() " the event not attach.
Also, if I put haxe.Timer(100) before it work fine...
It's looks like the browser not insert yet the content from the Ajax(c.item(0).innerHTML = content;) but what really weird is that if I do: "trace(doc.getElementById("registerSumbit"))" I get the dom of this element so it exist in DOM!!!
I so hate JS :( :( :@
Ah sorry for the problem initRegisterPage it looks correct. Random guess: is "registerSumbit" a typo for "registerSubmit"? Or maybe you have several "registerSumbit" elements?Also 'URLReq.onError("Can't load index");' immediately executes .onError - that's probably not the desired effect.On Thu, Jul 30, 2015 at 9:52 PM, Philippe Elsass <philipp...@gmail.com> wrote:What is wrong in your code is the for (btn in menu) loop: the onclick closures you create in the loop will all share the same btn variable (and value) which is defined/hoisted outside the loop. In short, all the buttons will use the last btn's href.If you want to capture a specific btn value with the onclick closure you should move that into a function: for (btn in menu) setClickHandler(btn);--On Thu, Jul 30, 2015 at 6:03 AM, michael solomon <miche...@gmail.com> wrote:Thanks, but If you look on my code you'll see that I turn in onData event... This should do the work.. No?
--
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.
Philippe
--Philippe
Thanks,
> What is wrong in your code is the for (btn in menu) loop: the onclick closures you create in the loop will all share the same btn variable (and value) which is defined/hoisted outside the loop. In short, all the buttons will use > the last btn's href.
"btn.onclick" in "for (btn in menu) " 0_0 or that I missed something...
--
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.