Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 8. Events > Reusing a Handler Function with Different Data

8.3. Reusing a Handler Function with Different Data

8.3.1. Problem

You’ve come into a situation where you have many bindings, and the handler functions look pretty similar. It doesn’t matter whether these bindings are applied to different element/event combinations. The thing is, you don’t want to repeat yourself over and over (who does?).

Here’s an example:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial