Web Technology
Web Technology
Web Technology
Web technology is defined as the technology that primarily deals with how
to save web information securely in webservers and how to retrieve
information from these servers using different internet based tool and
techniques. It is the methods by which computers communicate with each
other through the use of markup languages and multimedia packages.
Client-side scripting can be utilized to make websites more interactive. It is typically used at the front
end, which is where users can view the web page using the browser. In client side scripting the scripts are
executed by browsers without connecting the server. The most important functions of scripting on the
client side are listed below:
• To retrieve information from a web browser or the user's screen.
• To personalize the web page without having to load it again.
• Client-side scripting can be used to verify credentials. If the user has entered incorrect details when
logging in, the web page will display an error message on the user's machine and will not submit data
to the website server.
• The original name of JavaScript was Mocha( name chosen by founder of Netscape).
• It does not require any interaction to web server while processing scripts on web browser.
Or
<script type=“text/javascript”>………………………..</script>
Script can be placed either inside the <HEAD> tags or <BODY>tags. We can embed any number
of scripts in a webpage. In the <HEAD> tags, the scripts are run before the page displayed and in
the <BODY>tags, scripts are run as the page is displayed. Mostly, the functions and variables are
defined in the <HEAD>tags and these functions are used by the scripts within the <BODY> tags.
Scripts also can be stored in external file with file extension .js and such scripts can also be
loaded from external file by using the following examples.
<!DOCTYPE html>
<html>
<head>
<title>Hello World in JavaScript</title>
</head>
<body>
<script type="text/javascript">
document.write("Hello World");
</script>
</body>
</html>
Instead of using function document.write(), we can also use function getElementById(). This
feature helps to access particular tag in HTML using tag id.
<!DOCTYPE html>
<html>
<head>
<title>Hello World in JavaScript</title>
</head>
<body>
<p Id=“eg”></P>
<script type="text/javascript">
document.getElementById(“eg”).innerHTML=“Hello World”;
</script>
</body></html>
<script src=“eg.js”>
</script>
• alert(msg): It helps to make alerts to the user that something has happened.
• prompt(msg, default value): It helps to ask user to enter some text value.
<!DOCTYPE html>
<html>
<head>
<title>Example of User Interaction Functions</title>
</head>
<body>
<script type="text/javascript">
document.write("Example of alert, confirm and prompt:");
alert("Thanks for visiting my web page.");
confirm("Do you want to delete the file?");
prompt("Enter your Name:");
</script>
</body>
</html>
Example:
Var a;
Var roll_number=1;
Var name;
var x=100;
document.write("The value of x="+x);
</script>
</body>
</html>
Operator Description
+ Used for adding numbers and concatenates strings.
- Used for subtracting numbers.
* Used for numbers multiplication.
/ Used for numbers division.
% Used for numbers remainder division.
++ Used for incrementing the value of variable by 1.
-- Used for decrementing the value of variable by 1.
Operator Description
< Less than
<= Less than or equal to
> Greater than
>= Greater than or equal to
== Equal to
!= Not equal to
Operator Description
|| Logical OR
&& Logical AND
! Logical NOT
Operator Description
= Assignment
+= Add and assignment (Eg. a+=5 //a=a+5)
-= Subtract and assignment
*= Multiply and assignment
/= Divide and assignment
%= Modulus divide and assignment