File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Head First Android this week in the Android 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: 63052

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]
It is sorta covered in the JavaRanch Style Guide.
subject: JQuery:-different way to write function
It's not a secret anymore!