Skip to content

Instantly share code, notes, and snippets.

@Maciek416
Created June 10, 2010 18:32
Show Gist options
  • Select an option

  • Save Maciek416/433431 to your computer and use it in GitHub Desktop.

Select an option

Save Maciek416/433431 to your computer and use it in GitHub Desktop.
var code = 7;
// fn returns a handler with code as local 'secret'
var handler = (function(secret){
// return handler
return function(e){
self.setValue($(this).val() + secret);
}
})(code);
$("#bob").change(handler);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment