“The world’s most misunderstood language has become the world’s most popular programming language” Akshay Arora www.aroraakshay.in.

Slides:



Advertisements
Similar presentations
The JavaScript Programming Language
Advertisements

Introducing JavaScript
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Java Script Session1 INTRODUCTION.
Introduction to JavaScript
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
The Web Warrior Guide to Web Design Technologies
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Introduction to Scripting.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Javascript Client-side scripting. Up to now  We've seen a little about how to control  content with HTML  presentation with CSS  Javascript is a language.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
CST JavaScript Validating Form Data with JavaScript.
Taking JavaScript Seriously IS NOT THE WORST IDEA.
JavaScript CMPT 281. Outline Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages.
Javascript and the Web Whys and Hows of Javascript.
4.1 JavaScript Introduction
JavaScript: Control Structures September 27, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel, Deitel,
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
JavaScript JavaScript is a scripting language that is most commonly used to add client- side programming to a web page. Some of the things it is used for.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
1 JavaScript. 2 What’s wrong with JavaScript? A very powerful language, yet –Often hated –Browser inconsistencies –Misunderstood –Developers find it painful.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
An Introduction to JavaScript Summarized from Chapter 6 of “Web Programming: Building Internet Applications”, 3 rd Edition.
JS Basics 1 Lecture JavaScript - Basics. JS Basics 2 What is JavaScript JavaScript is a “simple”, interpreted, programming language with elementary object-
ALBERT WAVERING BOBBY SENG. Week 4: JavaScript  Quiz  Announcements/questions.
Client-side processing in JavaScript.... JavaScript history Motivations –lack of “dynamic content” on web pages animations etc user-customised displays.
Javascript. What is JavaScript? Scripting (interpreted) language designed for the web Beware: JavaScript is case sensitive.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
JavaScript Syntax, how to use it in a HTML document
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
JavaScript Introduction. Slide 2 Lecture Overview JavaScript background The purpose of JavaScript A first JavaScript example Introduction to getElementById.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
JavaScript Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
Introduction to JavaScript Fort Collins, CO Copyright © XTR Systems, LLC Introduction to JavaScript Programming Instructor: Joseph DiVerdi, Ph.D., MBA.
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
1 Javascript CS , Spring What is Javascript ? Browser scripting language  Dynamic page creation  Interactive  Embedded into HTML pages.
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
1 PHP Intro PHP Introduction After this lecture, you should be able to: Know the fundamental concepts of Web Scripting Languages in general, PHP in particular.
Java Script. introduction Today’s web sites need to go much beyond HTML. browsing through a web site, to actually interact with the web site. The web.
JavaScript Introduction inf385t Semantic Web 2/20/2006.
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
CGS 3066: Web Programming and Design Spring 2016 Introduction to JavaScript.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
JavaScript Tutorial First lecture 19/2/2016. Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part.
Javascript Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
JavaScripts.
>> Introduction to JavaScript
Scope, Objects, Strings, Numbers
14 A Brief Look at JavaScript and jQuery.
JavaScript Introduction
JavaScript an introduction.
Web Systems Development (CSC-215)
CS5220 Advanced Topics in Web Programming JavaScript Basics
JavaScript CS 4640 Programming Languages for Web Applications
Tutorial 10: Programming with javascript
CS3220 Web and Internet Programming JavaScript Basics
Introduction to JavaScript
Intro to Programming (in JavaScript)
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

“The world’s most misunderstood language has become the world’s most popular programming language” Akshay Arora

Most popular technologies – SO dev survey ‘15

The Name Java and JavaScript are as similar to each other as Car and Carpet.

What is JavaScript? JavaScript is a scripting language for web browsers. A scripting language is a language that "scripts" other things to do stuff. The primary focus is getting an existing “thing” to act the way you want.

Scripting language is an understatement JavaScript is a modern dynamic language. Used on both, Client and Server side.

Brief History of JavaScript It was originally developed by Netscape under the name “LiveScript”. The name was later changed to JavaScript. Including the prefix ‘Java’ was a marketing ploy of Netscape in order to make JavaScript look related to Java.

The language started to get popular with the second version of Netscape because of it being lightweight as compared to java applets. Microsoft reverse engineered the language and named it ‘Jscript’, just to escape from the Netscape lawyers :p.

JavaScript is interpreted, not compiled Since it is intended to be used in conjunction with a host (browser), it is made lightweight and fast. Compilation is time consuming and basically, not required.

Load and Go delivery In C/C++, the programs are delivered as an executable file. In JavaScript programs are delivered as text because it was originally intended to be embedded into web pages, and web pages are text. This makes JavaScript execution extremely simple.

Loose Type Casting In C/C++, Java, etc. you have to specify beforehand what type your variable will be. int x = 5; double d = 8.0; But JavaScript is loosely typed. It implies that JavaScript variables can be used without explicitly stating the type. var abc = 1; abc = "Changed to string";

Most of the things in JavaScript are objects JavaScript objects are key-value pairs. There is no such thing as a “class”. Functions, Arrays are also objects.

One Number type IEEE 754, also known as: double. 64-bit floating point. Implications: is not 0.3 but However, integer arithmetic is always exact.

Strings These are sequence of 16-bit characters. You can write strings in both single and double quotes. var str1 = 'I am a string'; var str2 = "Me too";

null A value that is nothing.

undefined A value that is not even that. :p It is the default value of all variables. var abc; console.log(abc);// undefined

=== and == operators == compares the values of the entities being compared irrespective of the type. var abc = "34"; var xyz = 34; Console.log(abc == xyz); //true === compares the values of the entities as well as their type. Console.log(abc === xyz); //false

Dynamic Objects Applies the concept of a hashtable (key/value pairs). var abc = new Object(); Creates an empty container of key/value pairs. A name can be any string, the value can be any value except undefined.

Make an object var company = new Object(); company.name = "Google"; company.headquarters = "Mountain View, CA"; company.makesMoneyThrough = "Advertisements";

Also var company = { "name":"Google", "headquarters":"Mountain View, CA", "makesMoneyThrough": "Advertisements" };

“The browser is really a very hostile programming environment”

Document Object Model It provides a structured representation of the document and it defines a way that the structure can be accessed from programs so that they can change the document structure, style and content. The DOM provides a representation of the document as a structured group of nodes and objects that have properties and methods.

Functions in JavaScript Functions are also objects in JavaScript. Code is stored in the form of strings. (Surprise!).

Using function constructor var sum = new Function('a','b', 'return a + b;'); console.log(sum(10, 20)); // 30

Using function declaration function sum(a, b) { return a + b; } console.log(sum(10, 10)); // 20

Using function expression var sum = function(a, b) { return a + b; } console.log(sum(5, 5)); // 10

Scopes There are no block scopes in JavaScript. There are only function scopes.

Events JavaScript is meant to provide interactivity to the webpages. The user does something on the page (Like click, hover,etc) and the page responds.

Event Handler It waits until a certain event has taken place. It “handles” the event by executing some JavaScript that you have defined.

3 rd Party Libraries and frameworks jQuery: Excellent and most popular JavaScript Library. Reactjs: Framework for creating powerful user interfaces (One-way data binding). Made by Facebook. Angular js: Framework for powerful web applications (Two-way data binding). Made by Google.

Recommended Reading Nearly all the books about JavaScript are quite awful. The good ones: Eloquent JavaScript by Marijin Haverbeke (Free ebook). JavaScript: The good parts by Douglas Crockford.