Web Application

BASIC CLIENT SCRIPTING OF JAVASCRIPT

javascript-4523100_1920

INTRODUCTION TO JAVASCRIPT

JavaScript is not a full-fledged language and it needs to be embedded within a HTML document. Otherwise, or to specify an external file that contains the JavaScript code we can use word script or program for the JavaScript code. The most common way to set off a script is to use the HTML  tags in HTML document. We can place our JavaScript code in either the HEAD or BODY section of a HTML document. The Syntax (General format) is Indicates ending of JavaScript Code.

.CLIENT SERVER MODEL

NODE
Node is a component or terminal connected to a network. The
components like laptops, PDAs, Internet enabled mobiles etc., can be
considered as node in a computer network.

CLIENT
It is a node computer that establishes connection with the server,
collects data from the user, sends it to the server, receives information
from the server and presents it to the user.

SERVER
In the context of client-server model, server is the counter part of
client. It is a computer that serves queries from the client. The programs
which respond to the request of clients are known as server
applications. The computer designed to run server application is known
as server machine. Web server, database server and mail server are
some examples of servers.

PLACING THE JAVASCRIPT CODE

There are two ways to place the JavaScript code : 1. Embedded/Inline JavaScript : JavaScript code can be placed either in the HEAD or in the BODY section of a HTML document. a. It is advised to place JavaScript code in HEAD section when it is required to be used more than once. b. If the JavaScript code is small in size and used only once, it is advisable to put it in the BODY section of the HTML document. 2. External JavaScript : In case, same JavaScript code needs to be used in multiple documents then it is the best approach to place JavaScript code in external files having extension as ì .jsî. 

COMMENTS
Comments are the statements that are always ignored by the interpreter.
They are used to give remarks to the statement making it more readable
and understandable to other programmers. There are two types of
comments :
– Single line comment using double-slash (//).
– Multiple lines comment using /* and */ .

For example :
// This is a single-line comment.
/* This is a multiple-line comment.
It can be of any length. */

LITERALS
Literals refer to the constant values, which are used directly in
JavaScript code. For example:
a=10;
b=5.7;
document.write(ìWelcomeî);
In above statements 10, 5.7, ìWelcomeî are literals.

VARIABLES
A variable is an identifier that can store values. These values can be
changed during the execution of script. Once a value is stored in a
variable it can be accessed using the variable name. Variable
declaration is not compulsory, though it is a good practice to use variable
declaration. Keyword var is used to declare a variable.
Syntax
var var-name [= value] […, var-name [= value] ]

    DEBAJYOTI SEN

    I am very passionate in making circuits and making websites.I have habit of reading story books and making models.

    https://samvaba.com/user/debajyotisen_2003/?um_action=edit

    4 thoughts on “BASIC CLIENT SCRIPTING OF JAVASCRIPT

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    Back To Top