Using Click Interceptions with a Database-Driven Application
One of the most popular approaches used for extending the behavior of database-driven web applications is one widely known as click interception. In case you’ve not heard about it yet, this useful technique consists of using JavaScript to change the default behavior of an element included in a web page when a user clicks on it. This technique expands the element's functionality; it is covered in detail in this four-part series. This article is the third part.
Using Click Interceptions with a Database-Driven Application (Page 1 of 4 )
Introduction
Of course, if you've developed JavaScript applications that utilize a few "onclick" event handlers as part of the pertinent programming logic, then it's quite possible that you've already used the concept of "click interception" without being aware of this. However, the best way to understand the foundations of this client-side approach is by means of a step-by-step guide that shows you how to apply it in real-word situations.
This series of articles provides you with numerous hands-on examples that will help you grasp very quickly how to utilize click interceptions in JavaScript to improve the functionality of some popular web applications. These include image galleries, interactive web forms, and a few others as well.
Having introduced you to the subject of this series, I assume that at this point you've become pretty familiar with using click interceptions to extend the behavior of certain web applications -- after all, in the two preceding articles of the series, I taught you how to utilize this approach to submit and validate a conventional web form via Ajax, and to improve the existing functionality of a basic image gallery.
While the aforementioned examples were admittedly quite simplistic, they did demonstrate in a nutshell how useful click interceptions can be when used intelligently. Nonetheless, as I stated in the beginning, this JavaScript-based technique can be utilized in many other cases.
Therefore, based on the versatility offered by click interceptions, in this third chapter of the series, I'm going to teach you how to apply them to extend the behavior of a simple MySQL-driven web application. This application fetches a few user-related records from a database table and displays detailed information on these users in a different window. In this case, the click interception approach will be used to modify the way that the detail web pages are created, in this way extending their functionality.
Now, let's learn together how to utilize click interceptions to enrich the behavior of the aforementioned MySQL-driven web application. Let's get started!