0% found this document useful (0 votes)
4 views

Module_3-NOTES

This document covers Chapter 6 of a module on JavaScript, focusing on client-side scripting and its role in web development. It outlines the advantages and disadvantages of using JavaScript, including its interoperability across browsers and the challenges of ensuring functionality when JavaScript is disabled. Additionally, it provides a brief history of JavaScript, its evolution, and its significance in modern web applications, particularly with the rise of AJAX.

Uploaded by

Bharani ISE
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Module_3-NOTES

This document covers Chapter 6 of a module on JavaScript, focusing on client-side scripting and its role in web development. It outlines the advantages and disadvantages of using JavaScript, including its interoperability across browsers and the challenges of ensuring functionality when JavaScript is disabled. Additionally, it provides a brief history of JavaScript, its evolution, and its significance in modern web applications, particularly with the rise of AJAX.

Uploaded by

Bharani ISE
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

MODULE 3

CHAPTER 6 - JavaScript: Client-Side Scripting


CHAPTER 8 - Introduction to Server-Side
Development with PHP

CHAPTER 6
JavaScript: Client-Side Scripting
Chapter Objectives
In this chapter you will learn . . .
■ About the role of client-side scripting in web development
■ How to create fail-safe design that will work even if JavaScript is
not enabled
■ The important syntactic elements of JavaScript
■ About built-in JavaScript objects
■ How to prevalidate forms using JavaScript

Subtopics

6.1 What Is JavaScript and What Can It Do?


6.2 JavaScript Design Principles
6.3 Where Does JavaScript Go?
6.4 Syntax
6.5 JavaScript Objects
6.6 The Document Object Model (DOM)
6.7 JavaScript Events
6.8 Forms
----------------------------------------------------------------
------
6.1 What Is JavaScript and What Can It Do?
6.1.1 Client-side scripting
6.1.2 javascript’s history and Uses

JavaScript and Java are vastly different programming languages with different uses.

Sl Java Javascript
No
1 Full-fledged object oriented Fewer of the object-oriented
language features of Java
2 Runs on any platform with a Java Runs directly inside the browser,
Virtual Machine installed without the need for the JVM.
3 In Java, variables are statically In JavaScript, the variables are
typed dynamically typed
4 The data type of a variable is The variables can be easily (or
defined by the programmer (e.g., implicitly) converted from one data
int abc) and enforced by the type to another.
compiler.
5 With JavaScript, the type of data a
variable can hold is assigned at
runtime and can change during run
time as well.

6.1.1 Client-side scripting

 The idea of client-side scripting is an important one in web


development.
 It refers to the client machine (i.e., the browser) running code
locally rather than relying on the server to execute code and return
the result.
 There are many client-side languages that have come into use over the
past decade including Flash, VBScript, Java, and JavaScript.
 Some of these technologies only work in certain browsers, while
others require plug-ins to function.
 This chapter focuses on JavaScript due to its browser interoperability
(that is, its ability to work/operate on most browsers).
 Figure 6.1 illustrates how a client machine downloads and executes
JavaScript code.
 There are many advantages of client-side scripting:
■ Processing can be offloaded from the server to client machines,
thereby
reducing the load on the server.
■ The browser can respond more rapidly to user events than a request
to a
remote server ever could, which improves the user experience.

Advantages of client-side scripting:
■ Processing can be offloaded from the server to client machines, thereby
reducing the load on the server.
■ The browser can respond more rapidly to user events than a request to a
remote server ever could, which improves the user experience.
■ JavaScript can interact with the downloaded HTML in a way that the server
cannot, creating a user experience more like desktop software than simple
HTML ever could.

The disadvantages of client-side scripting


■ There is no guarantee that the client has JavaScript enabled, meaning any
required functionality must be housed on the server, despite the possibility
that it could be offloaded.
■ The idiosyncrasies between various browsers and operating systems make it
difficult to test for all potential client configurations. What works in one
browser, may generate an error in another.
■ JavaScript-heavy web applications can be complicated to debug and maintain.
JavaScript has often been used through inline HTML hooks that are embedded into
the HTML of a web page. Although this technique has been used for years, it has
the distinct disadvantage of blending HTML and JavaScript together, which
decreases code readability, and increases the difficulty of web development.

6.1.2 Javascript’s history and Uses


JavaScript was introduced by Netscape in their Navigator browser back in 1996. It
originally was called LiveScript
Internet Explorer (IE) at first did not support JavaScript, but instead had its
own browser-based scripting language (VBScript). While IE now does support
JavaScript, Microsoft sometimes refers to it as JScript, primarily for trademark reasons (Oracle
currently owns the trademark for JavaScript). The current version for
JavaScript at the time of writing is 1.8.5.
It wasn’t until the middle of the 2000s with the emergence of so-called AJAX
sites that JavaScript became a much more important part of web development.
AJAX is both an acronym as well as a general term. As an acronym it means
Asynchronous JavaScript and XML

You might also like