This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 63349

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] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: JQuery:-different way to write function
It's not a secret anymore!