The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jeroend (23) [Avatar] Offline
#1
Hi, I like the book a lot so far but I think I already mentioned that once. However yesterday I was struggling with bind functions and variables outside and inside the closure. Took me quite some time get it working with partial functions and in the end I unsuccessfully left that path, shortly after finding the eventData optional parameter, which solved all my problems.
Allthough the api tells this is lesser used parameter it solved all my problems, and I think that more people will benefit from it, I certainly would have.
It would be really great if you can also point out if my original thoughts for partial functions would also have worked.

regards,
Jeroen.
bear.bibeault (675) [Avatar] Offline
#2
Re: eventdata
I'm not quite sure what you mean by "partial functions".
jeroend (23) [Avatar] Offline
#3
Re: eventdata
Well actually I meant it's there, but it is never mentioned in the examples (I guess I'm more of an example guy), and the way it is explained in the book did not make that much impression as the explanation on the jquery api site did.
bear.bibeault (675) [Avatar] Offline
#4
Re: eventdata
I'm still not sure to what you are referring.
jeroend (23) [Avatar] Offline
#5
Re: eventdata
Partial functions were explained by john in resig in.
http://ejohn.org/blog/partial-functions-in-javascript/

And I hoped that I could use that to create bind functions with external parameters in the body of the function.
My use case is comparable to that described in http://www.packtpub.com/article/jquery-table-manipulation-part1 (search for .bind).

regards,
Jeroen.
jeroend (23) [Avatar] Offline
#6
Re: eventdata
Ha I think I found it, I think I was looking for immediate functions as explained in listing 4.18 in secrets of js-ninja v9.