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
  • PrintPrint

Understanding Scope

One important concept that you need to understand about working with handlers involves variable scope. The term scope refers to the location in a script where a variable can be seen and accessed. Variable scope varies, depending on how and where variables are declared.

Local Scope

By default, any variables declared inside of an event handler are local in scope. A local variable is one that can only be accessed within its current scope. Therefore, a variable that is local to a handler cannot be accessed from outside that handler.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint