Defining Dynamic HTTP Validation
For those websites that read data as often as it is written, the static HTTP validation approach would be wrong because updating the file takes too many resources. In the case of dynamic HTTP validation, the server application framework has to manage everything, which includes the generation and verification of the entity tag. The major problem to solve is the generation of the entity tag ETag identifier. Traditionally, web developers do not write an ETag identifier. But what is an entity tag...
Implementation Nzk
The Infinite Data pattern implementation in this chapter will be a simple example of calculating all prime numbers up to a specified value. So if the specified value were 9, all the prime numbers up to the number 9 would be 2, 3, 5, and 7. This simple algorithm is useful because it allows us to focus on the architecture and mechanics of the Infinite Data pattern. For those wondering, the prime number calculation routine is a brute force technique that tests whether a number is prime. What is...
A Simple Example
The simplest of all navigations is the link, which in the default case will replace the current content with the content of another URL. The notation of the link is defined as follows lt a The a HTML element has an href attribute, which indicates the destination URL that the web browser will navigate to. Clicking on a link results in whatever content you have loaded being replaced with the content that the URL http www.apress.com contains. With respect to writing Ajax applications, these types...
Understanding the Special Nature of innerHTML
The property innerHTML is special in that it seems simple to use but can have devastating consequences. To illustrate the problem, consider the following HTML code lt title gt Document Chunk HTML lt title gt lt script language JavaScript hello hello table 0 .rows 0 .cells 0 .innerHTML lt button lt button lt button lt table id mytable border 1 gt lt tr id myrow gt lt td cell lt td gt lt tr gt lt table gt lt body gt lt html gt In this example, there are three buttons GoodReplace, BadReplace, and...
Implementing a Search
Implementing the local clients means implementing a search client, which is called by both the synchronous and asynchronous interfaces. The Amazon.com and Google search engines were chosen as examples because each one uses a different web service technology. For the Amazon.com search engine, the local client will use client-side REST technologies. For the Google search engine, the local client will use client-side SOAP technologies. For each of the local client implementations, the...
JavaScript Chunking
Another form of chunking is the sending of JavaScript. Sending JavaScript can be very effective because you don't need to parse the data but only execute the JavaScript. From a client script point of view it is very easy to implement. For reference purposes, do not consider downloading JavaScript faster than manually parsing and processing XML data and then converting the data into JavaScript instructions. JavaScript that is downloaded needs to be parsed and validated before being executed. The...
Example Server Push
For each example, the level of complexity has increased, and the only remaining scenario to explain is the server push. What makes a server push unique is that each client accessing the global resource for example, http mydomain.com global resource has a unique child URL for example, In previous examples, the URL used was a global resource that was shared among individual users. This time the URL must be unique because when the server pushes content, it is individualized. As a side note, when...
Defining an XMLHttpRequest Factory
Getting back to the Factory pattern and instantiation of XMLHttpRequest, the pattern is needed because each browser for example, Firefox, Internet Explorer, and Safari has a different way of instantiating the XMLHttpRequest object, and using the Factory pattern is the only way to mask the decision of the object instantiation. If you search the Internet query XMLHttpRequest factory , you'll find a multitude of techniques proposed to abstract the instantiation of XMLHttpRequest. As much as I...
Event Bubbling
HTML events can be associated with any HTML element. The HTML event can be triggered in two ways the HTML element triggers the event, or the HTML element contains another element that triggers the event. HTML has a unique characteristic in that events can pass up a hierarchy of elements in a process called event bubbling. In event bubbling, an HTML element triggers an event that is sent from one HTML element to another HTML element. The idea is to pass the HTML event from the child to the...
Introduction to Ajax
Asynchronous JavaScript and XML Ajax 1 is both something old and something new old because already existing technologies are used, but new because it combines these existing technologies into techniques that very few considered previously. Simply put, because of Ajax a new generation of applications and ideas are bubbling on the developer scene. A very brief definition of Ajax is as follows Ajax is a technology that complements Web 2.0 and the integration of many web This brief definition...


