Web server logs - CHAPTER 6 DECOUPLED NAVIGATION PATTERN Nothing yet

CHAPTER 6 DECOUPLED NAVIGATION PATTERN
Nothing yet

The changed content in the HTML page is bold. The changes are to only one function. This means that the change from processing data locally to remotely has been implemented trans parently without updating the HTML elements responsible for the user interface, the OnClick or the InjectHTML function. The overall application still looks and feels the same, with the only noticeable change being the speed of converting the text to bold. Let s focus on ConvertToBolded, which is illustrated again as follows: function ConvertToBolded( common) common.parent.initializeRemote( common) common.complete = function( cmdEmbedded, status, statusText, responseText, responseXML) cmdEmbedded.state.text = responseText; return true; } var buffer = common.state.text; E B V N common.async.post( “/ajax/chap10/remotecontent.html”, “application/text”, buffer.length, buffer); return true; } In the implementation of the ConvertToBolded, there is a call to initializeRemote. The method initializeRemotesets up the functions and data members necessary to make a remote server call by using the Asynchronous type. The definition of the common.complete function is required by Asynchronous and is called when the remote call has completed. The existence of common.complete splits the Common Data functionality into two pieces. The first piece is the creation of the remote server call request, and the second piece is the processing of the results. The last part of the ConvertToBolded method is to send the data to the server by using the method common.async.post (HTTP POST). Sending the data is the first step of the two-step Common Data functionality. The server will process the data and return a modified state to the caller. The modified state is then processed by the common.completemethod, which is the second step of the two-step Common Data functionality. As the second step is part of the Common Data functionality, the Presentation functionality can be called thereafter. Before the implementation of initializeRemote is started, a better way to explain the calling sequence is to illustrate it. Figure 6-16 makes it simpler to explain how the method initializeRemote is implemented.
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Leave a Reply