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

Chapter 9. Handling Events > Debugging and Troubleshooting Script Problems

Debugging and Troubleshooting Script Problems

Avoiding Infinite Loops with the Blur and Focus Events

I used a single Blur event handler for two consecutive form fields, and the browser got stuck in an infinite loop.

This is a common problem when handling the Blur event. To understand why, you need to understand when and how the Blur and Focus events fire. First, let's look at the sample script in Listing 9.11 to illustrate the problem.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint