O
Unit-3 Overview of JavaScript Web Designing-1
Overview of Scripting Language
All scripting languages are programming languages.
The scripting language is basically a language where instructions are written for a
run time environment.
They do not require the compilation step and are rather interpreted.
A scripting language is a programming language designed for integrating and
communicating with other programming languages.
The role of scripting language is to add various functionality to a web page.
There are two types of scripting languages:
1.Client-side scripting language
2.Server-side scripting language
Example of scripting languages:JavaScript,ASP,PHP,Perl,JSP and Python.
Client side scripting
Client-side scripting is set of codes that are executed by the server.
Example of client-side scripts are JavaScript and VBScript.
Client-side scripts contain programs for browser.
Interact with temporary storage
Make interactive web pages
Interact with local storage
Sending request for data to server
Send request to server
work as an interface between server and user
Example: JavaScript, HTML, Ajax, CSS etc.
E.g. when a button is clicked , these instructions are executed without
concerning any server interaction.
Server side scripting
Server-side scripts are written in languages such as Perl,PHP,ASP.net,etc.
When user requests such type of document containing these scripts then
these scripts are executed by the web server.
Server-side scripting is generally used as an interface to databases or other
data stores to make website more interactive.
Querying the database
Operations over databases
Access/Write a file on server.
Interact with other servers.
Page No. 1
,O
Unit-3 Overview of JavaScript Web Designing-1
Structure web applications.
Process user input. For example if user input is a text in search box,run a search
algorithm on data stored on server and search the results.
Example: PHP,C++,Python , JSP etc.
Structure of JavaScript
JavaScript is a programming language initially designed to interact with elements of
web pages.
JavaScript allows you to add interactivity to a web page. Typically, you use JavaScript
with HTML and CSS to enhance a web page’s functionality, such as validating forms,
creating interactive maps, and displaying animated charts.
We can write the JavaScript on the different location of the webpage:
1. Inside <Script> tag:
In HTML, JavaScript code is inserted between <script> and </script> tags.
Example:
<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>
2. Inside <head> :
In this example, a JavaScript function is placed in the <head> section of an HTML
page.
The function is invoked(called) when button is clicked.
Example:
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction()
{
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
Page No. 2
, O
Unit-3 Overview of JavaScript Web Designing-1
</head>
<body>
<h1>A Web Page</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>
</body>
</html>
3. Inside <body> :
In this example, a JavaScript function is placed in the <body> section of an HTML
page.
The function is invoked(called) when button is clicked.
Example:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>A Web Page</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</body>
</html>
Page No. 3
Unit-3 Overview of JavaScript Web Designing-1
Overview of Scripting Language
All scripting languages are programming languages.
The scripting language is basically a language where instructions are written for a
run time environment.
They do not require the compilation step and are rather interpreted.
A scripting language is a programming language designed for integrating and
communicating with other programming languages.
The role of scripting language is to add various functionality to a web page.
There are two types of scripting languages:
1.Client-side scripting language
2.Server-side scripting language
Example of scripting languages:JavaScript,ASP,PHP,Perl,JSP and Python.
Client side scripting
Client-side scripting is set of codes that are executed by the server.
Example of client-side scripts are JavaScript and VBScript.
Client-side scripts contain programs for browser.
Interact with temporary storage
Make interactive web pages
Interact with local storage
Sending request for data to server
Send request to server
work as an interface between server and user
Example: JavaScript, HTML, Ajax, CSS etc.
E.g. when a button is clicked , these instructions are executed without
concerning any server interaction.
Server side scripting
Server-side scripts are written in languages such as Perl,PHP,ASP.net,etc.
When user requests such type of document containing these scripts then
these scripts are executed by the web server.
Server-side scripting is generally used as an interface to databases or other
data stores to make website more interactive.
Querying the database
Operations over databases
Access/Write a file on server.
Interact with other servers.
Page No. 1
,O
Unit-3 Overview of JavaScript Web Designing-1
Structure web applications.
Process user input. For example if user input is a text in search box,run a search
algorithm on data stored on server and search the results.
Example: PHP,C++,Python , JSP etc.
Structure of JavaScript
JavaScript is a programming language initially designed to interact with elements of
web pages.
JavaScript allows you to add interactivity to a web page. Typically, you use JavaScript
with HTML and CSS to enhance a web page’s functionality, such as validating forms,
creating interactive maps, and displaying animated charts.
We can write the JavaScript on the different location of the webpage:
1. Inside <Script> tag:
In HTML, JavaScript code is inserted between <script> and </script> tags.
Example:
<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>
2. Inside <head> :
In this example, a JavaScript function is placed in the <head> section of an HTML
page.
The function is invoked(called) when button is clicked.
Example:
<!DOCTYPE html>
<html>
<head>
<script>
function myFunction()
{
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
Page No. 2
, O
Unit-3 Overview of JavaScript Web Designing-1
</head>
<body>
<h1>A Web Page</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>
</body>
</html>
3. Inside <body> :
In this example, a JavaScript function is placed in the <body> section of an HTML
page.
The function is invoked(called) when button is clicked.
Example:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>A Web Page</h1>
<p id="demo">A Paragraph</p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction()
{
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</body>
</html>
Page No. 3