Another use of an remote scripting no less beneficial then doing calculations and lookups is replacing a portion of a page's content with blocks of static content. The handleResponse code snippets presented earlier used the innerHTML property to do just this. A reasonable person might have expected this to be the first demonstration. Ah, how devious some minds.

Default Initial Text

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Click on any link in the following list and the content in the box on the right will change.

On a side note, the division that contains the new content is wrapped in a floated division. This is partly to address the IE5.0 box model bug and to reduce distractions that occur in some browsers when the display changes. By setting the width attribute of one element and setting the padding and border values of the other element, the displayed size is the same across browsers.

The functions do_rpc, createXHR, and handleResponse used in this example are exactly the same as in the technique explanation.