• Post Reply Bookmark Topic Watch Topic
  • New Topic

JQuery:-different way to write function  RSS feed

 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have written a bind event in following style



i get key object as parameter to onAutoKeyUp(key) function, now i have a requirement to pass few more parameters so i used different style


wonder how to use .keyup and pass more parameters.

-P
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66158
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not the way that JavaScript works. If you need data to be in scope during the execution of a function, closures are the customary way to make sure that it can be accessed.

Without more information I can't really give any examples.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!