We can use innerHTML to change a loaded page (HERE).
Or, we could get ideas from others like the TinyBox code provided by Michael Leigeber. This script provides a neat effect for a modal window that can accept any AJAX or HTML input. For example, a Picture, or a Web page, a PopUp Ad, or your favorite YouTube video.
In this chapter, we will take a a look at how to create Web pages whose content and layout can be modified using built-in programs. In our discussion of Forms, we learned about accessing programs involving forms and CGI scripts and running programs that are stored and run off the Web server. Here are some disadvantages to this approach:
- users have to be connected to the Web server to run the CGI script
- only the programmer of the script can alter the script
- the system administrator of the Web server can place limits on how users can access the script
- continually accessing the server can slow it down and overload the system
These issues led to the development of programs, or scripts, that could be run from the Web browser on the user's own computer (the client) as illustrated below.
Client-side programs solve many problems associate with CGI scripts. Computing is distributed over the Web so that no one server is overloaded with handling programming requests. Since the user does not have to wait for data to be sent over the Internet to the Web server, client-side programs are likely to be more responsive to the user. Client-side programs can never completely replace CGI scripts because needed data is stored on the server.