Download Advanced Web Design

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Advanced Web Design
Scripting Tutorial Chapters
Scripting Intro
The scripting part of the forthcoming
Advanced Web Design textbook
introduces you to the concept of
scripting and steps you through a
programming primer in which you
learn how to create different kinds
of scripts. To get started, you should
go to Chapter 9 and work through it
at your own pace.
What Is Scripting?
Scripting is the act of writing little
computer programs that can enhance the
appearance and functionality of a web page.
Browsers render web pages by placing
objects onscreen.
Scripts let you grab hold of those objects
to make them do special things.
What Can Scripts Do?
You can grab hold of the browser’s status
bar, for example, and write a message into
it.
You can make text on your web pages
display active content, such as the current
date and time.
You can create rollover effects that
highlight a graphic, make sounds, and pop
out explanatory messages when the user
moves the mouse over an object onscreen.
Scripts Can Process Forms
When the user clicks a button to
submit something typed into a text
field, you can grab hold of the text
field and validate what the user
entered into it.
You can also write scripts that use
cookies to remember things as the
user navigates from screen to screen.
Scripting Languages
There are many different brands of
scripting languages.
This course teaches you how to use
the four leading brands, which are
JavaScript, VBScript, JScript, and a
new language called C#.
The book divides into columns
devoted to the different scripting
languages.
Where Do Scripts Go?
You can put scripts in the head or in
the body section of a web page.
Scripts can also reside in separate
files that get included in the page at
runtime.
The .NET framework, for example,
enables you to create code-behind
files that keep your scripts separate
from your HTML.
Where Do Scripts Run?
Scripts run either on the client (i.e., in the
browser) or on the server that hosts the web site.
JavaScript is an example of a scripting language
that runs on the client. When a browser
encounters JavaScript on a web page, the browser
processes the script and renders the result
onscreen.
ASP scripts, on the other hand, run on the server.
When a browser asks a server to display an ASP
page, the server executes any JScript or VBScript
on the page before sending the response to the
browser.
Hello, World!
Let’s work through the Hello, World
example together.
JavaScript
JScript
VBScript
Scripting Variables
Chapter 10 introduces the concept of
a variable and teaches you how to
assign values to string variables and
numeric variables. After learning how
to stylize and concatenate variables
into print strings, you create a clock
script that displays the current date
and time onscreen.
Scripting Logic
Learning how to program arrays,
loops, and comparisons brings a new
dimension to your scripting prowess.
That new dimension is logic. In
chapter 11 you learn how to give your
scripts the ability to acquire
knowledge and make decisions.
Scripting Functions
Learning how to write functions can
help you organize your code better
and save time writing scripts. Chapter
12 teaches you how to write functions
and use include files to make your
functions easy to maintain.
Scripting Forms and Cookies
Chapter 13 teaches you how to write
scripts that process forms. You will learn
how to write an ASP script to receive and
process data posted by a form. Then you
learn to use cookies to maintain state as
the user moves from page to page. As a
final touch, you learn how to read the
values of the cookies and make decisions
based on what the user has done at your
web site.
Document Object Model
Chapter 14 introduces the Document
Object Model (DOM).
The DOM is the official W3C
structural definition of the objects,
methods, and properties that
comprise documents on the World
Wide Web.
DHMTL Effects
By manipulating objects in the DOM,
you can create dynamic HTML
(DHTML) effects, including rollovers.
Chapter 14 teaches you how to create
rollovers and other kinds of DHTML
effects using Microsoft FrontPage.
Another Approach
For students who would like to try a
new approach to teaching scripting, I
have printed a few copies of the
Introduction to Scripting from
ITAW.
I would value your feedback,
especially if you find any glitches in
this newly written tutorial.