So far, this chapter discussed frames,
iframes, and how to use Ajax and
<div> elements to produce pages that
work in the same basic way. All of this really boils down to the
structure of the page, or how the page is laid out. This section of
the chapter will not cover where elements should be presented on a
page. That is certainly not in the scope of this book. Instead, we
need to evaluate how the structure of a page can be more or less
dynamic and flexible.
It is extremely important for Ajax developers to think about the dynamic nature that their pages will take on. It is fine and dandy to create some widgets that open up, slide out, or appear and disappear at the click of a button. Unless those widgets are placed correctly, however, the page might not function properly or parts of it may become inaccessible. To avoid this, you should think about how to make all of the individual pieces of the page independent of one another. This way, you can move things around without degrading the widget in the process.
The placement of dynamic widgets on a page is not the biggest issue a developer will face when dealing with dynamic content. A much more important issue is how dynamic data could break the application accidentally or maliciously when the data received is not what is expected.
An easy way to accomplish this sort of structure is to make sure all objects that are placed in the page have a wrapper or container around them. Wrappers enable ...