Dedicated web hosting - 168 CHAPTER 6 DECOUPLED NAVIGATION PATTERN Figure
168 CHAPTER 6 DECOUPLED NAVIGATION PATTERN Figure 6-10. Sequence of steps: clicking on an HTML element and identifying the results E B V N Canceling Bubbled Events Events that are bubbled can be canceled, but there is a caveat in that not all events can be canceled. However, let s put off that caveat for the moment. When an event let s say a click is bubbled, it can be canceled. Canceling an event is appropriate if you don t want a link clicked under certain circumstances. Or another example is an HTML form that should not be submitted after the validation has failed. Consider the following HTML:
The example shows three links: apress, google, and slashdot. The three links are nested within a div element that has implemented the onclick event. Notice in this example how the implementation of the onclick event prefixes the return keyword before the function MonitorLinks. Using the returnkeyword is essential in canceling the click event, and in general those events that can be canceled. If an event is captured and processed, the functionality can return true to continue the event bubbling, or false to cancel the event bubbling. The purpose of the function MonitorLinks is to selectively allow a clicked link to navigate to its destination. Logically, the MonitorLinks function will allow navigation to the slashdot link, but not the apressor google links. The implementation of MonitorLinks is illustrated as follows:
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.