Introduction
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. 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. 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. The database part
of this book will provide you with scripts that can store, query, and
update information in data tables.
What
prevents many would-be programmers from succeeding at scripting, however,
is learning how to handle the many different kinds of events that can
happen when the user interacts with a web page. This book takes a new
approach that removes this obstacle to learning how to script. Instead
of expecting you to learn how to program your own event handlers, this
book teaches you how to use Visual Studio tools that create event handlers
automatically. This reduces considerably the complexity of the scripts
you write. If you are one of the many non-programmers who are afraid of
scripting because you tried learning it before but got stuck when it became
too complex, now it is time to try again. Work through the scripting primer
in this part of the book. It will teach you how to assign values to variables,
perform comparisons, write active content onscreen, and grab hold of the
objects that the browsers use to interact with the user. These are things
that almost anyone who can think logically can learn how to do by following
the step-by-step instructions in the primer part of the book.
After
you complete the primer, you will be able to assess whether or not you
want to continue programming or instead work from a graphical perspective
as you proceed into the more advanced sections of this book. If you are
working on a team, you may discover that some of the team members like
to program, while others prefer working from a graphical perspective.
Every team member should complete the scripting primer, however, so that
all of the team will understand what scripts can accomplish. Then your
team can plan when and where to employ scripts in accomplishing your project’s
goals.
|