Download presentation
Presentation is loading. Please wait.
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 goes here */ -->
10
Putting Scripts in a Separate File <script type=“text/ecmascript” language=“JavaScript” src=“path/to/script.js”> 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 document is 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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.