SlideShare a Scribd company logo
JavaScript

       By
Dr. Ejaz Ahmed
Scripting Language Javascript
• JavaScript was designed to add interactivity to HTML
  pages
• JavaScript is a scripting language
• A scripting language is a lightweight programming
  language
• JavaScript is usually embedded directly into HTML
  pages
• JavaScript is an interpreted language (means that
  scripts execute without preliminary compilation)
• Everyone can use JavaScript without purchasing a
  license
Are Java and JavaScript the same?
• NO!
• Java and JavaScript are two completely different
  languages in both concept and design!
• Java (developed by Sun Microsystems) is a
  powerful and much more complex programming
  language - in the same category as C and C++.
• JavaScript was invented by Brendan Eich at
  Netscape (with Navigator 2.0), and has appeared
  in all browsers since 1996.
Introduction
•   JavaScript was designed to add interactivity to HTML pages.
•   JavaScript is a scripting language.
•   JavaScript is usually embedded directly into HTML pages.
•   JavaScript is an interpreted language (means that scripts
    execute without preliminary compilation).
•   It is an event-driven language.
•   To insert a JavaScript into an HTML page, use the <script>
    tag.
•   Inside the <script> tag use the type attribute to define the
    scripting language.
•   The <script> and </script> tells where the JavaScript starts
    and ends. <script type="text/javascript">
How to use javascript?
• The common way to use the javascript is as follows;
• Define some HTML tag with ID attribute value given.
• In that HTML tag add/call the function statement and
  bind it to some event on which you want to invoke the
  javascript function (event handler).
• Write the said function (event handler) between
  <script> and </script> tags.
• When the page downloads, your handler will be called
  on event you described within the HTML tag.
What can a JavaScript do?
• JavaScript gives HTML designers a programming tool - HTML authors
  are normally not programmers, but JavaScript is a scripting language
  with a very simple syntax! Almost anyone can put small "snippets" of
  code into their HTML pages
• JavaScript can put dynamic text into an HTML page - A JavaScript
  statement like this:
       document.write("<h1>" + name + "</h1>")
• can write a variable text into an HTML page
• JavaScript can react to events - A JavaScript can be set to execute
  when something happens, like when a page has finished loading or
  when a user clicks on an HTML element
• JavaScript can read and write HTML elements - A JavaScript can read
  and change the content of an HTML element
• JavaScript can be used to validate data - A JavaScript can be used to
  validate form data before it is submitted to a server. This saves the
  server from extra processing
Ajax
• AJAX = Asynchronous JavaScript and XML.
• AJAX is not a new programming language, but a new way to
  use existing standards.
• AJAX is the art of exchanging data with a server, and update
  parts of a web page - without reloading the whole page.
• AJAX allows web pages to be updated asynchronously by
  exchanging small amounts of data with the server behind the
  scenes. This means that it is possible to update parts of a
  web page, without reloading the whole page.
• Classic web pages, (which do not use AJAX) must reload the
  entire page if the content should change.
• Examples of applications using AJAX: Google Maps, Gmail,
  Youtube, and Facebook tabs.
How Ajax Works?
Web Servers
•   jakarta-tomcat-5.0.28 (with jdk)
•   Dot Net (.Net) Framwork
•   IBM WebSphere
•   ZendCore
•   etc.
Getting Started with JavaScript
         Event: onclick
Introducing document
‘getElementById()’ method
Validation Through JavaScript
Example
Example …
Example – Data conversions and
         Calculations
Example – Dialogue Box & Pop up
            Window
Code - Dialogue Box & Pop up
           Window
Example – Dialogue Box &
      Calculations
Pop up window and Document
           Write
Java script202
HTML JavaScript Arrays

More Related Content

PPTX
Unobtrusive js
bretticus
 
PDF
Visual resume
Milan Skorić
 
PPTX
Evolution of java script libraries
Columbia Developers Guild
 
PPTX
Introduction To JavaScript Ajax
Reema
 
PPTX
Real life cross-platform application development using Xamarin Forms - Frank ...
Codemotion
 
PPTX
Javascript Myths and its Evolution
Deepu S Nath
 
PPTX
JavaScript Performance (at SFJS)
Steve Souders
 
PPTX
Introduction to mean stack
Praveen Gubbala
 
Unobtrusive js
bretticus
 
Visual resume
Milan Skorić
 
Evolution of java script libraries
Columbia Developers Guild
 
Introduction To JavaScript Ajax
Reema
 
Real life cross-platform application development using Xamarin Forms - Frank ...
Codemotion
 
Javascript Myths and its Evolution
Deepu S Nath
 
JavaScript Performance (at SFJS)
Steve Souders
 
Introduction to mean stack
Praveen Gubbala
 

What's hot (20)

PPT
JAVA SCRIPT
Go4Guru
 
PPTX
Ajax assignment help
john mayer
 
PDF
Modern Static Site with GatsbyJS
Riza Fahmi
 
PPT
Get MEAN! Node.js and the MEAN stack
Nicholas McClay
 
PPTX
What is Mean Stack Development ?
Balajihope
 
PDF
MEAN Stack
Krishnaprasad k
 
PPT
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Mahbubur Rahman
 
PDF
MEAN Stack - Google Developers Live 10/03/2013
Valeri Karpov
 
PPTX
HTML5 for Rich User Experience
Mahbubur Rahman
 
PDF
The MEAN stack - SoCalCodeCamp - june 29th 2014
Simona Clapan
 
PPTX
Jsp
JayaKamal
 
PPTX
Node.JS| Coffeescript Presentation
Sam Frons
 
PPTX
Mean PPT
Harendra Singh Bisht
 
PDF
Client Vs. Server Rendering
David Amend
 
PDF
Wordpress as a Backend
Andrew Duthie
 
PDF
Introduction to the MEAN stack
Yoann Gotthilf
 
PDF
Building JavaScript Apps for Force.com with EmberJS
Salesforce Developers
 
PDF
Modern web application devlopment workflow
Hamdi Hmidi
 
PDF
Using WordPress as a Backend for Your React Project
Adam Rasheed
 
PDF
Ajax and RJS
Dominiek ter Heide
 
JAVA SCRIPT
Go4Guru
 
Ajax assignment help
john mayer
 
Modern Static Site with GatsbyJS
Riza Fahmi
 
Get MEAN! Node.js and the MEAN stack
Nicholas McClay
 
What is Mean Stack Development ?
Balajihope
 
MEAN Stack
Krishnaprasad k
 
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Mahbubur Rahman
 
MEAN Stack - Google Developers Live 10/03/2013
Valeri Karpov
 
HTML5 for Rich User Experience
Mahbubur Rahman
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
Simona Clapan
 
Node.JS| Coffeescript Presentation
Sam Frons
 
Client Vs. Server Rendering
David Amend
 
Wordpress as a Backend
Andrew Duthie
 
Introduction to the MEAN stack
Yoann Gotthilf
 
Building JavaScript Apps for Force.com with EmberJS
Salesforce Developers
 
Modern web application devlopment workflow
Hamdi Hmidi
 
Using WordPress as a Backend for Your React Project
Adam Rasheed
 
Ajax and RJS
Dominiek ter Heide
 
Ad

Similar to Java script202 (20)

DOC
Basics java scripts
ch samaram
 
PPT
Java script
sanjay joshi
 
PPT
Java script
umesh patil
 
PDF
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
PPTX
Client side scripting using Javascript
Bansari Shah
 
PPTX
Java script
Abhishek Kesharwani
 
PDF
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
PDF
Web programming UNIT II by Bhavsingh Maloth
Bhavsingh Maloth
 
PPTX
Java script Session No 1
Saif Ullah Dar
 
DOC
Java script by Act Academy
actanimation
 
PPTX
JavaScript: Implementations And Applications
Pragya Pai
 
PPTX
Java Script - A New Look
rumsan
 
PDF
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
kavigamage62
 
PPT
Introduction to Javascript
Firdaus Adib
 
PPT
Java script
umesh patil
 
PPTX
Java script introduction
Jesus Obenita Jr.
 
PPTX
Java script Basic
Jaya Kumari
 
PPT
Session vii(java scriptbasics)
Shrijan Tiwari
 
PDF
JS BASICS JAVA SCRIPT SCRIPTING
Arulkumar
 
PPTX
Java script
Rajkiran Mummadi
 
Basics java scripts
ch samaram
 
Java script
sanjay joshi
 
Java script
umesh patil
 
CS8651- Unit 2 - JS.internet programming paper anna university -2017 regulation
amrashbhanuabdul
 
Client side scripting using Javascript
Bansari Shah
 
Java script
Abhishek Kesharwani
 
WEB PROGRAMMING UNIT II BY BHAVSINGH MALOTH
Bhavsingh Maloth
 
Web programming UNIT II by Bhavsingh Maloth
Bhavsingh Maloth
 
Java script Session No 1
Saif Ullah Dar
 
Java script by Act Academy
actanimation
 
JavaScript: Implementations And Applications
Pragya Pai
 
Java Script - A New Look
rumsan
 
java-scriptcdvcx vnbm,azsdfghjkml;sxdfcgmndxfcgvhb nmfctgvbhjnm ,cfgvb nm,xc ...
kavigamage62
 
Introduction to Javascript
Firdaus Adib
 
Java script
umesh patil
 
Java script introduction
Jesus Obenita Jr.
 
Java script Basic
Jaya Kumari
 
Session vii(java scriptbasics)
Shrijan Tiwari
 
JS BASICS JAVA SCRIPT SCRIPTING
Arulkumar
 
Java script
Rajkiran Mummadi
 
Ad

Java script202

  • 1. JavaScript By Dr. Ejaz Ahmed
  • 2. Scripting Language Javascript • JavaScript was designed to add interactivity to HTML pages • JavaScript is a scripting language • A scripting language is a lightweight programming language • JavaScript is usually embedded directly into HTML pages • JavaScript is an interpreted language (means that scripts execute without preliminary compilation) • Everyone can use JavaScript without purchasing a license
  • 3. Are Java and JavaScript the same? • NO! • Java and JavaScript are two completely different languages in both concept and design! • Java (developed by Sun Microsystems) is a powerful and much more complex programming language - in the same category as C and C++. • JavaScript was invented by Brendan Eich at Netscape (with Navigator 2.0), and has appeared in all browsers since 1996.
  • 4. Introduction • JavaScript was designed to add interactivity to HTML pages. • JavaScript is a scripting language. • JavaScript is usually embedded directly into HTML pages. • JavaScript is an interpreted language (means that scripts execute without preliminary compilation). • It is an event-driven language. • To insert a JavaScript into an HTML page, use the <script> tag. • Inside the <script> tag use the type attribute to define the scripting language. • The <script> and </script> tells where the JavaScript starts and ends. <script type="text/javascript">
  • 5. How to use javascript? • The common way to use the javascript is as follows; • Define some HTML tag with ID attribute value given. • In that HTML tag add/call the function statement and bind it to some event on which you want to invoke the javascript function (event handler). • Write the said function (event handler) between <script> and </script> tags. • When the page downloads, your handler will be called on event you described within the HTML tag.
  • 6. What can a JavaScript do? • JavaScript gives HTML designers a programming tool - HTML authors are normally not programmers, but JavaScript is a scripting language with a very simple syntax! Almost anyone can put small "snippets" of code into their HTML pages • JavaScript can put dynamic text into an HTML page - A JavaScript statement like this: document.write("<h1>" + name + "</h1>") • can write a variable text into an HTML page • JavaScript can react to events - A JavaScript can be set to execute when something happens, like when a page has finished loading or when a user clicks on an HTML element • JavaScript can read and write HTML elements - A JavaScript can read and change the content of an HTML element • JavaScript can be used to validate data - A JavaScript can be used to validate form data before it is submitted to a server. This saves the server from extra processing
  • 7. Ajax • AJAX = Asynchronous JavaScript and XML. • AJAX is not a new programming language, but a new way to use existing standards. • AJAX is the art of exchanging data with a server, and update parts of a web page - without reloading the whole page. • AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page. • Classic web pages, (which do not use AJAX) must reload the entire page if the content should change. • Examples of applications using AJAX: Google Maps, Gmail, Youtube, and Facebook tabs.
  • 9. Web Servers • jakarta-tomcat-5.0.28 (with jdk) • Dot Net (.Net) Framwork • IBM WebSphere • ZendCore • etc.
  • 10. Getting Started with JavaScript Event: onclick
  • 15. Example – Data conversions and Calculations
  • 16. Example – Dialogue Box & Pop up Window
  • 17. Code - Dialogue Box & Pop up Window
  • 18. Example – Dialogue Box & Calculations
  • 19. Pop up window and Document Write