jQuery in Action, 3rd edition
The moose likes HTML, CSS and JavaScript and the fly likes JQuery:-different way to write function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JQuery:-different way to write function " Watch "JQuery:-different way to write function " New topic

JQuery:-different way to write function

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 641

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.


All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63540

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.

[Asking smart questions] [About Bear] [Books by Bear]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: JQuery:-different way to write function
It's not a secret anymore!