Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 15 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
15
Dung lượng
702,1 KB
Nội dung
1 Ch.11 - WWW techniques 1 Interactivity on the Web 2 CGI forms 3 CGI programs 4 Creating a form 5 Form tag 6 JavaScript 7 What can JavaScript do? 8 Shockwave 9 Adobe Acrobat 10 Acrobat software 11 RealAudio 12 Internet telephony 13 Internet and conventional telephones Ch.11 - WWW techniques 2 Five years ago, the Web was very static. You could see text and graphics and you could click on links. Then other types of media started to appear; sound, animation, video and interactive applications. The interactivity was brought about by four different techniques. The first is the Plug-in technique. A plug-in is not a part of a browser. It is a separate program that is invoked by the browser when it encounters a file with a format that the plug- in module can understand. There are hundreds of plug-ins on the Internet that you can download and install on your computer. Some of them cost money, but most of them are free. The difficulty with plug-ins is that you have to find them, download them and install them. First you must find the right plug-in on the Internet. There are different plug-ins for different platforms, so you have to make sure that the plug-in that you want to download is the right one. Then you have to download the plug-in; a process that typically takes 10 to 20 minutes through a 28.8 kbps modem. The file you’ve downloaded is almost always archived and compressed, so you have to decompress and de-archive it. Then you have to install the plug- in before you’re ready to use it. There is another variant of the plug-in technique called a helper application. A helper application is exactly the same thing as a plug-in, that is a small program that is invoked by the browser. The only difference is that a plug-in shows its information within the window of the browser, while a helper applications shows its information in an external window. The second technique is called CGI, which stands for Common Gateway Interface. One use is for entering data in a form on a web page and submitting it by clicking on a button. Another use is to sense where the user clicks on an active image area. There are many other ways to use CGI. The third technique, called the Scripting Languages, involves extending the HTML code by using a programming language called a script language. The code of the scripting language is Ch.11 - WWW techniques 3 mixed with the HTML code. When you open an HTML page with a word processor you can actually see the code of the scripting language. The browser interprets the scripting language code in a similar way it interprets the HTML code. The most common scripting language is JavaScript. The fourth technique is Java. This technique involves sending, not just the data from the server to the client, but also the program that will handle this data. In this way users don’t have to find, download and install plug-ins on their computers. Ch.11 - WWW techniques 4 The only way you could interact with the Web before 1995 was by clicking on hyperlinks. In 1995 Web forms started to appear. A form is a web page with one or more entry fields and a mandatory "submit" button. The name of this "submit" button could be anything that is appropriate to the situation like "Send", "Submit", "Search now" or "Evaluate". You enter data into the fields and click on the submit button to send the form's contents to the server. Ch.11 - WWW techniques 5 When you click on the submit button the browser collects all data from the form and sends it to the server. The server passes the data to a program using a protocol called CGI, which stands for Common Gateway Interface. The CGI program typically interacts with a database to service the form's request. At the end of this process the CGI program returns a reply HTML document which is sent as a feedback to the user. Ch.11 - WWW techniques 6 To create a form you must first create the HTML page. You must then write the server CGI program that will handle the data from the input form. You must also design a reply HTML document that will be sent to the user as a feedback. The reply document is usually dynamically created by the CGI program after processing the data. Finally you must upload everything on the server. Ch.11 - WWW techniques 7 A form begins with <FORM> and ends with </FORM>. After the FORM you will always see two attributes: METHOD and ACTION. METHOD can have two values, either a GET or a POST. GET causes the data to be appended to the URL after a separating question mark. POST on the other hand appends the data to the body of the HTML message. The ACTION attribute specifies the URL of the CGI program that will process the data. Ch.11 - WWW techniques 8 JavaScript is a programming language. The purpose of JavaScript is to give HTML pages some interactive power, by adding JavaScript code to the existing HTML code of a web page. There are two common myths about JavaScript. The first one is that JavaScript is a part of Java. This is not so. JavaScript and Java language are two different things. The other myth is that JavaScript is simple. Also this is incorrect. JavaScript is an object- oriented language that requires sophisticated programming skills. Ch.11 - WWW techniques 9 Here are some examples of what JavaScript can do: - JavaScript can capture events that are initiated by the user, when he clicks on a button, moves the mouse over a link or enters a value in a field. An example is to display a special message in the status line when the user positions the mouse over a hyperlink. - JavaScript can interact with the document’s form elements like button, checkbox, radio, password, reset, submit, select, text and textarea. You can for instance create a calculator or an income tax estimator. - JavaScript can interact with Java applets and plug-ins. They can talk and control one another. - JavaScript allows you to write arbitrary HTML into a document. You can for instance display different texts on different platforms, include today's date in the document or generate documents entirely from scratch. - JavaScript allows you to control the browser. You can create and open entirely new browser windows, which can have a specified appearance. The new window can for instance have a specified size and appear without toolbar, location, directory buttons, status line, and scrollbars. - JavaScript can change the images in a document. This allows effects like changing an image when the mouse passes over it. - JavaScript can identify the platform and browser it is running on and can customize behavior based on the browser being used. Ch.11 - WWW techniques 10 The most commonly used tool to create interactive multimedia applications is Director from Macromedia. Director is to multimedia production what PageMaker and QuarkXPress are to desktop publishing. From the beginning the only way to play Director applications was from your hard disk or from a CD-ROM. Macromedia wanted to make Director applications available from the Web, so they created Shockwave plug-in. Shockwave plug-in is essentially a Director playback engine. In order to create a shockwave application you have to create a director application and save is as a shockwave file. You also have to create an HTML page that will refer to the shockwave file through an embed tag. Finally you have to upload both the HTML page and your shockwave file to a server. The user has to have a shockwave plug-in on the client side. When he loads the HTML page from the server the shockwave file will also join the party. Now the user can enjoy an interactive application without having to communicate with the server all the time. There are different variants of Shockwave; Shockwave Director, Shockwave Authorware, Shockwave Flash, and more. Shockwave Authorware is used together with Authorware from Macromedia. Authorware is a multimedia production application that is well suited for making educational applications. Shockwave Flash uses vector-based graphics, which means that the animations are very small and can be quickly downloaded to the client. . 1 Ch.11 - WWW techniques 1 Interactivity on the Web 2 CGI forms 3 CGI programs 4 Creating a form 5 Form tag 6. Acrobat software 11 RealAudio 12 Internet telephony 13 Internet and conventional telephones Ch.11 - WWW techniques 2 Five years ago, the Web was very static. You could see text and graphics and you. programming language called a script language. The code of the scripting language is Ch.11 - WWW techniques 3 mixed with the HTML code. When you open an HTML page with a word processor you can