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

Department of Computer Science and Engineering (CSE)

Department of Computer Science

University Institute of
Engineering
DEPARTMENT OF COMPUTER
SCIENCE & ENGINEERING
Bachelor of Engineering
Subject Name: Web Technologies(HTML)

DISCOVER . LEARN .
EMPOWER 1
University Institute of Engineering (UIE)
Department of Computer Science Department
and Engineering
of computer
(CSE) Sci

Lecture -1
Topics covered

• Introduction to java script


• History of JavaScript
• How to Run JavaScript

• Tools You Need


• implementation method
• Java script syntax

2
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)

Introduction to java script

• JavaScript is a cross-platform, object-oriented scripting


language used to make webpages interactive (e.g., having
complex animations, clickable buttons, popup menus,
etc.). There are also more advanced server side versions
of JavaScript such as Node.js, which allow you to add
more functionality to a website than downloading files
(such as realtime collaboration between multiple
computers). Inside a host environment (for example, a
web browser), JavaScript can be connected to the objects
of its environment to provide programmatic control over
them.

3
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)

• JavaScript contains a standard library of objects, such as Array, Date,


and Math, and a core set of language elements such as operators,
control structures, and statements. Core JavaScript can be extended for
a variety of purposes by supplementing it with additional objects; for
example:

• Client-side JavaScript extends the core language by supplying objects


to control a browser and its Document Object Model (DOM). For
example, client-side extensions allow an application to place elements
on an HTML form and respond to user events such as mouse clicks,
form input, and page navigation.

• Server-side JavaScript extends the core language by supplying objects


relevant to running JavaScript on a server. For example, server-side
extensions allow an application to communicate with a database,
provide continuity of information from one invocation to another of
the application, or perform file manipulations on a server.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

History Of JavaScript
• The language was initially called Live Script and was later
renamed JavaScript. There are many programmers who
think that JavaScript and Java are the same. In fact,
JavaScript and Java are very much unrelated. Java is a
very complex programming language whereas JavaScript
is only a scripting language. The syntax of JavaScript is
mostly influenced by the programming language C.

5
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)

How to Run JavaScript


• JavaScript cannot run on its own. In fact, the browser is
responsible for running JavaScript code. When a user
requests an HTML page with JavaScript in it, the script is
sent to the browser and it is up to the browser to execute it.
The main advantage of JavaScript is that all modern web
browsers support JavaScript. So, you do not have to worry
about whether your site visitor uses Internet Explorer,
Google Chrome, Firefox or any other browser. JavaScript
will be supported. Also, JavaScript runs on any operating
system including Windows, Linux or Mac. Thus, JavaScript
overcomes the main disadvantages of VBScript which is
limited to just IE and Windows.

6
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)

Tools You Need


• To start with, you need a text editor to write your
code and a browser to display the web pages you
develop. You can use a text editor of your choice
including Notepad++, Visual Studio Code,
Sublime Text, Atom or any other text editor you
are comfortable with. You can use any web
browser including Google Chrome, Firefox,
Microsoft Edge, Internet Explorer etc.

7
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)

A Simple JavaScript Program


• You should place all your JavaScript code within
<script> tags (<script> and </script>) if you are
keeping your JavaScript code within the HTML
document itself.

8
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)

A Simple JavaScript Program


• <html>
• <head>
• <title>My First JavaScript code!!!</title>
• <script type="text/javascript">
• alert("Hello World!");
• </script>
• </head>
• <body>
• </body>
• </html>
9
University Institute of Engineering (UIE)
Department of Computer Science and Engineering (CSE)

JavaScript compared to Java

JavaScript Java

Object-oriented. No distinction between types of Class-based. Objects are divided into classes and
objects. Inheritance is through the prototype instances with all inheritance through the class
mechanism, and properties and methods can be hierarchy. Classes and instances cannot have
added to any object dynamically. properties or methods added dynamically.

Variable data types are not declared (dynamic Variable data types must be declared (static
typing, loosely typed). typing, strongly typed).

Cannot automatically write to hard disk. Can automatically write to hard disk.

10
University Institute of Engineering (UIE)
Department of Computer and Communication Engineering (CCE)

Practice Questions
1. Write a Java script program to print hello and welcome to
CU.
2. Create a function that takes two numbers as arguments and
return their sum.

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

References
• http://nptel.ac.in/courses/Webcourse-contents/IISc-BA
NG/notused/IISc/New%20Rajaram%20pdfs/module8.p
df
• http://ecomputernotes.com/fundamental/what-is-a-dat
abase/type-of-data-models
• https://beginnersbook.com/2015/04/data-models-in-d
bms/
• http://www.odbms.org/wp-content/uploads/2013/11/
Data_Modeling_ConcepttoDBMS.pdf

University Institute of Engineering (UIE)


Department of Computer Science and Engineering (CSE)

Thank you

University Institute of Engineering (UIE)

You might also like