Nothing Special   »   [go: up one dir, main page]

Web Technology II Part 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 14

Web Technology II Part 1

By : Subein Byanjankar
Learning Objectives
• Introduction
• Server Side and Client Side Scripting
• Introduction to Internet Technology
• Introduction to JAVASCRIPT
• Adding JavaScript to HTML Page
• JavaScript Fundamentals
Introduction to Web technology
• Tools and techniques used in communication in
networks that includes the following.
– Interface between Web servers and Clients
– Development, transfer and management of contents
– Database
– Protocols
– Programming, scripting languages and frameworks.
– Multimedia
– Data formats and packet structures
Server Side and Client Side Scripting
• World Wide Web (WWW) is a client server
network.
• Running scripts on client and server determine
client side or server side.
• Scripting is required to perform different activities.
• Eg: listening to a button click event to perform a
task.
• Eg: Saving data filled up in an online registration
form.
Client Side Scripting
• Script or program that is run on the local
machine by the browser.
• Runs on client browser
• Script is downloaded and executed on the client.
• Completely Browser dependent.
• Not used to connect to databases.
• Possible to be disabled by the user.
• Eg: HTML, JAVASCRIPT, VBSCRIPT etc
Server Side Scripting
• Executes on the web server.
• Code is run when the data is requested by the client.
• Depends on the Web Server and is independent of web
browser.
• Customized responses and session handling.
• More secure
• Code is not downloaded.
• Users cannot disable the codes.
• Used to connect to database
• Examples: PHP, ASP, ASP.NET, Python, RUBY, JSP etc
Internet Technology
• Internet is Network of Networks
• Makes use of TCP/IP protocol.
• Global communication using multimedia, network that is world
wide.
• It is a collection of standalone computers and computer networks
linked together.
• Internet technologies mean the technologies that use one or more
computer networks utilizing TCP/IP or other architectures,
terminals, computers, routers, servers etc.
• Contents in internet are downloaded, streamed or pre-cached.
• Terms like DNS, URL, HTTP, WWW, FTP, Browser, Client, Server etc
are used in Internet Technologies.
Introduction to Javascript
• Most popular and widely used client side language.
• Designed to add interactivity and dynamic effects to web pages.
• Developed by Netscape in 1990s. Named Javascript in 1995. It
became ECMA standard in 1997.
• Javascript is standard client side scripting language for web
based applications.
• Javascript is Object Oriented Language, Has similar
programming syntax to JAVA programming langugage
• Javascript and JAVA is not related in terms of origination.
Javascript was named after a co marketing deal occurred
between Netscape and Sun.
Adding Javascript to HTML: Embedding
<!doctype html>
<html>
<head>
<script>
document.getElementById("greet").innerHTML="HELLO";
</script>
</head>
<body>
<p id="greet"></p>
</body>
</html>
Adding Javascript: External Javascript
• Javascript standalone files can be saved as .js file, here greet.js
<!doctype html>
<html>
<head>
</head>
<body>
<p id="greet"></p>
<script src="greet.js">
</script>

</body>
</html>
• IN greet.js file the following codes are written.

document.getElementById("greet").innerHTML="HELLO";
Adding Javascript: Inline
• Can be added inline for actions on multiple events of elements.
Small codes are used.
<!doctype html>
<html>
<head>
</head>
<body>
<p id="greet“ you for
clicking')">click me</p>
</body>
</html>
Javascript Fundamentals
• Javascript can be added to the HTML page in any manner.
• Most of the libraries are available in javascript that require to
be included in the head part
• Multiple Javascripts can be placed in HTML files.
• Scripts are managed in small areas where the scripts are
required.
• Such Scripts are places inside <script> tags
• Uses end of statement ‘;’ to determine a line.
• Case Sensitive
• Comments are given by // for single line and /* */ for multiple
lines.
Outputs
• Writing to Browser console:
– Eg: console.log(“Text”)
– Will display a text in the browser console, used usually by developers for
debugging
• Alert dialogs
– Eg: alert(“text”)
– Will generate an alert box with text.
• Writing to browser window. (contents)
– Eg: document.write(“text”)
– Will write the text to the contents area of the browser.
• Writing to an element
– Eg: document.getElementById(“greet”).innerHTML=“text”
– Will write the text to the element that has the id called greet.
Keywords
• var, function, if, else, do, while, for, switch,
break, continue, return, try, catch, finally,
debugger, case, class, this, default, false, true,
in, instanceOf, typeOf, new, null, throw, void,
width, delete, let etc.

THE END

You might also like