11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<br />

<br />

Back to previous page<br />

<br />

<br />

<br />

While <strong>JavaScript</strong> can be used to preserve state and even create something as powerful as a<br />

shopping cart, it is not a good idea at all to use it in this fashion unless you are constantly<br />

making sure to address script being turned off mid-visit. Also, you may find the easy<br />

accessibility of script code a little too open for performing such an important task as preserving<br />

state information across pages. Until client-side scripting facilities become more robust, Web<br />

programmers probably should rely on traditional state management mechanisms such as<br />

cookies to maintain state between pages in a site.<br />

Window Extensions<br />

Given that the Window object really doesn‘t fall completely under any one standard—DOM or<br />

<strong>JavaScript</strong>—and that it is so core to a user‘s experience, numerous extensions to the object<br />

have been made. Most of these are so new and proprietary that they have yet to be adopted by<br />

Web designers at large. This section presents an overview of some of the more useful window<br />

extensions made by browser vendors.<br />

IE Window Extensions: Modal, Modeless, and Pop-Up Windows<br />

Internet Explorer supports a few special types of windows. <strong>The</strong> first is the modal window. Like a<br />

standard dialog, this more generic window is modal to the page and must be dismissed before<br />

moving on. <strong>The</strong> basic syntax to create a modal dialog is<br />

window.showModalDialog(URL of dialog, arguments, features);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!