1 / 12

Lecture 3B: Client-Side Scripting

Lecture 3B: Client-Side Scripting. IT 202—Internet Applications Based on notes developed by Morgan Benton. For Today. Client-side scripting. Review of Client/Server Model. For networked applications, processing power is a valuable resource

delano
Download Presentation

Lecture 3B: Client-Side Scripting

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 3B:Client-Side Scripting IT 202—Internet Applications Based on notes developed by Morgan Benton

  2. For Today • Client-side scripting

  3. Review of Client/Server Model • For networked applications, processing power is a valuable resource • Most of the time both servers and clients possess processing power (i.e. they each have their own CPU) • The decision has to be made about whether to run application logic on the client side, or the server side of the application

  4. Reasons for Using Client-Side Scripting • HTML by itself is primarily for presentation of static information and provides poor support for interactivity • Using the client’s CPU for processing improves response time of apps • Decreases the processing load of the server making the server run more efficiently

  5. Reasons NOT to use Scripts • Browser compatibility • Some users intentionally disable scripts in their browsers • Scripts have limited permissions to resources on users’ computers

  6. Which Scripting Language? • A variety exist including JavaScript, Jscript, VBScript, ECMAScript, Tcl • Only JavaScript is supported by all (or at least most) browsers • ECMAScript is the standardized version of JavaScript

  7. What is JavaScript • JavaScript has almost no connection whatsoever with the Java programming language • Developed by Netscape • Has evolved into a standard supported by ECMA (European Computer Manufacturers’ Association)

  8. A guideline for using scripts • A significant number of people think that scripting should only be used for non-essential functions in a website. In other words, a user should be able to make full use of your site even if he/she doesn’t have a browser that supports scripts or she/he has scripts turned off.

  9. Using Scripts within HTML <script type=“text/ecmascript” language=“JavaScript”> <!-- /* script goes here */ --> </script>

  10. Putting Scripts in a Separate File <script type=“text/ecmascript” language=“JavaScript” src=“path/to/script.js”> </script> In a separate file labeled script.js you would add your code. This allows you to use the same code in many documents without having to retype the code in each one. Makes maintaining the scripts easier much as CSS makes maintaining formatting for a site easier.

  11. The DOM • DOM stands for Document Object Model • It is the way that you are able to access the elements on your page • documentis the top level object and refers to the web page in which the script resides

  12. Let’s do it! • Together we will create a script that will dynamically change a graphic on a web page when a user mouses over it.

More Related