0 ratings0% found this document useful (0 votes) 90 views22 pagesClient Side Programming (Javascript)
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
CHAPTER
CLIENT SIDE PROGRAMMING
(JAVASCRIPT)
10.0 INTRODUCTION
Javascript can be thought of as an extension to HTML,
which allows authors to incorporate some sanctionality in
their web pages. So, now, whenever the user presses the
‘SUBMIT button, you don’t necessarily have to invoke a cgi
script to do the processing. If it is something simple, you
can do the processing locally using Java script and give
back the results. Java script can also be used in a number
of ways to spice up your web page.
+ Itis a cross-platform scripting language developed
by Netscape.
+ Itcan be used for both client side and server side
applications.
+ Client-side Javascript is typically executed in a
browser that supports the language.
+ Itis an interpreted object based language that can
be included in HTML page.
+ You can access a number of elements in your
HTML page and manipulate them using Java script.
+ Helps in the creation of HTML pages capable of
responding to user events like mouse clicks, key
presses, selection of elements in the form.
Java Scripts is a scripting language that reflects the
object orientation of web pages. HTML documents that
include Java script can react to visitor actions, process and
check information that visitor provide, and even deliver
na0
VYYVYYYYYYYYYY
vyy
Inside this Chapter
Introduction
What is JavaScript?
What can a JavaScript Do?
Introduction to java Script Syntax
Variables
Statements in Java Script
Using Operations in Java Script
JavaScript Popup Boxes
JavaScript Functions
JavaScript Loops
Events and Event Handling
JavaScript-Catching Errors
Insert Special Characters
Object Model in Java Script
(Object Oriented Programming)
The HTML DOM
Browser Detection
Form Handling (Processing
Forms Using Hidden Fields)
JavaScript Animation
JavaScript Timing Events
Miscellaneous Topics
@ scanned with OKEN Scanner© appropriate to each visitor, For example, you can use Java script to change a buttons
1@ Mouse cursor moves over it.
10.1 WHAT IS JAVASCRIPT?
+ JavaScript was de
ned to add interactivity to HTML pages.
Pane
+ A JavaScript consists oflines of executable computer | both concept and design! Java
code (developed by Sun Microsystems)
+ A JavaScripts usually embedded directly into HTML |S a powerful and much more
pages ‘complex programming language ~
+ JavaScripts an interpreted language (means that [nthe same cetogon/ a5 Cand Cr,
sctpts execute wihnout pratiinary compilation)
+ Everyone can use JavaScript without purchasing a license.
10.2 WHAT CAN A JAVASCRIPT DO?
+ JavaScript gives HTML designers a programming tool- HTML authors are normally not
programmers, bl JavaScripts a scripting language with avery simple syntax! Almost anyone
‘can put small "snippets" of fo their HTML pages
can put dynamic text into an HTML page - A JavaScript statement lke this:
docu + name + "") can write a variable text into an HTML page
+ JavaScript can react to events - A JavaScript can be set to execute when something
happens, like when a page has finished loading or when a user clicks on an HTML element
‘can read and write HTML elements - A JavaScript can read and change the
content of an HTML element
‘can be used to validate data -A JavaScript can be used to validate form data
submitted to a server. This saves the server from extra processing
er - A JavaScript can be used to
W's browser, and - depending on the browser-load another page specifically
designed for that browser
+ JavaScript can be used to create cookies -A JavaScript can be used to store and retrieve
information on the visitors computer,
10.3 INTRODUCTION TO JAVA SCRIPT SYNTAX
Now we will see how a javascript code is put into html page
cheml>
ebody>
escript type="text /Javascript*>
document .write|