Updating One Window from Another
If you deal with forms and data entered by your users, you’ll want to know how to send information entered in one window to another window for display. You might use this in a situation where you are selling a product to replicate the user’s information in a summary window. In this example, we’ll use two windows: the main window is the parent window, which will receive and display information entered in a child window. Script 6.5 and Script 6.6 show the parent and child HTML pages, respectively. Script 6.7 shows the script, which is called from both the parent and child windows.
Script 6.5. The HTML for the parent window.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ... |
Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.