SlideShare una empresa de Scribd logo
1 de 21
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
HTML JavaScript Arrays

Más contenido relacionado

La actualidad más candente

JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPTGo4Guru
 
Ajax assignment help
Ajax assignment helpAjax assignment help
Ajax assignment helpjohn mayer
 
Modern Static Site with GatsbyJS
Modern Static Site with GatsbyJSModern Static Site with GatsbyJS
Modern Static Site with GatsbyJSRiza Fahmi
 
Get MEAN! Node.js and the MEAN stack
Get MEAN!  Node.js and the MEAN stackGet MEAN!  Node.js and the MEAN stack
Get MEAN! Node.js and the MEAN stackNicholas McClay
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?Balajihope
 
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...Mahbubur Rahman
 
MEAN Stack - Google Developers Live 10/03/2013
MEAN Stack - Google Developers Live 10/03/2013MEAN Stack - Google Developers Live 10/03/2013
MEAN Stack - Google Developers Live 10/03/2013Valeri Karpov
 
HTML5 for Rich User Experience
HTML5 for Rich User ExperienceHTML5 for Rich User Experience
HTML5 for Rich User ExperienceMahbubur Rahman
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014Simona Clapan
 
Node.JS| Coffeescript Presentation
Node.JS| Coffeescript PresentationNode.JS| Coffeescript Presentation
Node.JS| Coffeescript PresentationSam Frons
 
Client Vs. Server Rendering
Client Vs. Server RenderingClient Vs. Server Rendering
Client Vs. Server RenderingDavid Amend
 
Wordpress as a Backend
Wordpress as a BackendWordpress as a Backend
Wordpress as a BackendAndrew Duthie
 
Introduction to the MEAN stack
Introduction to the MEAN stackIntroduction to the MEAN stack
Introduction to the MEAN stackYoann Gotthilf
 
Building JavaScript Apps for Force.com with EmberJS
Building JavaScript Apps for Force.com with EmberJSBuilding JavaScript Apps for Force.com with EmberJS
Building JavaScript Apps for Force.com with EmberJSSalesforce Developers
 
Modern web application devlopment workflow
Modern web application devlopment workflowModern web application devlopment workflow
Modern web application devlopment workflowHamdi Hmidi
 
Using WordPress as a Backend for Your React Project
Using WordPress as a Backend for Your React ProjectUsing WordPress as a Backend for Your React Project
Using WordPress as a Backend for Your React ProjectAdam Rasheed
 

La actualidad más candente (20)

JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
 
Ajax assignment help
Ajax assignment helpAjax assignment help
Ajax assignment help
 
Modern Static Site with GatsbyJS
Modern Static Site with GatsbyJSModern Static Site with GatsbyJS
Modern Static Site with GatsbyJS
 
Get MEAN! Node.js and the MEAN stack
Get MEAN!  Node.js and the MEAN stackGet MEAN!  Node.js and the MEAN stack
Get MEAN! Node.js and the MEAN stack
 
What is Mean Stack Development ?
What is Mean Stack Development ?What is Mean Stack Development ?
What is Mean Stack Development ?
 
MEAN Stack
MEAN StackMEAN Stack
MEAN Stack
 
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
Taking Advantage of Client Side / JavsScript Templates in Rich Internet Appli...
 
MEAN Stack - Google Developers Live 10/03/2013
MEAN Stack - Google Developers Live 10/03/2013MEAN Stack - Google Developers Live 10/03/2013
MEAN Stack - Google Developers Live 10/03/2013
 
HTML5 for Rich User Experience
HTML5 for Rich User ExperienceHTML5 for Rich User Experience
HTML5 for Rich User Experience
 
The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014The MEAN stack - SoCalCodeCamp - june 29th 2014
The MEAN stack - SoCalCodeCamp - june 29th 2014
 
Jsp
JspJsp
Jsp
 
Node.JS| Coffeescript Presentation
Node.JS| Coffeescript PresentationNode.JS| Coffeescript Presentation
Node.JS| Coffeescript Presentation
 
Mean PPT
Mean PPTMean PPT
Mean PPT
 
Client Vs. Server Rendering
Client Vs. Server RenderingClient Vs. Server Rendering
Client Vs. Server Rendering
 
Wordpress as a Backend
Wordpress as a BackendWordpress as a Backend
Wordpress as a Backend
 
Introduction to the MEAN stack
Introduction to the MEAN stackIntroduction to the MEAN stack
Introduction to the MEAN stack
 
Building JavaScript Apps for Force.com with EmberJS
Building JavaScript Apps for Force.com with EmberJSBuilding JavaScript Apps for Force.com with EmberJS
Building JavaScript Apps for Force.com with EmberJS
 
Modern web application devlopment workflow
Modern web application devlopment workflowModern web application devlopment workflow
Modern web application devlopment workflow
 
Using WordPress as a Backend for Your React Project
Using WordPress as a Backend for Your React ProjectUsing WordPress as a Backend for Your React Project
Using WordPress as a Backend for Your React Project
 
Ajax and RJS
Ajax and RJSAjax and RJS
Ajax and RJS
 

Similar a Java script202

Javascript
JavascriptJavascript
JavascriptMozxai
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scriptsch samaram
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Lookrumsan
 
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSON
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSONAn introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSON
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSONSyed Moosa Kaleem
 
Session vii(java scriptbasics)
Session vii(java scriptbasics)Session vii(java scriptbasics)
Session vii(java scriptbasics)Shrijan Tiwari
 
JS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTINGJS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTINGArulkumar
 
Java script by Act Academy
Java script by Act AcademyJava script by Act Academy
Java script by Act Academyactanimation
 
Java script writing javascript
Java script writing javascriptJava script writing javascript
Java script writing javascriptJesus Obenita Jr.
 
JavaScript - Getting Started.pptx
JavaScript - Getting Started.pptxJavaScript - Getting Started.pptx
JavaScript - Getting Started.pptxJonnJorellPunto
 
JavaScript New Tutorial Class XI and XII.pptx
JavaScript New Tutorial Class XI and XII.pptxJavaScript New Tutorial Class XI and XII.pptx
JavaScript New Tutorial Class XI and XII.pptxrish15r890
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to JqueryGurpreet singh
 
JavaScript: Implementations And Applications
JavaScript: Implementations And ApplicationsJavaScript: Implementations And Applications
JavaScript: Implementations And ApplicationsPragya Pai
 
Hsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdfHsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdfAAFREEN SHAIKH
 

Similar a Java script202 (20)

Java script
Java scriptJava script
Java script
 
Java script
Java scriptJava script
Java script
 
Java script
Java scriptJava script
Java script
 
Javascript
JavascriptJavascript
Javascript
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Look
 
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSON
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSONAn introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSON
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSON
 
Session vii(java scriptbasics)
Session vii(java scriptbasics)Session vii(java scriptbasics)
Session vii(java scriptbasics)
 
JS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTINGJS BASICS JAVA SCRIPT SCRIPTING
JS BASICS JAVA SCRIPT SCRIPTING
 
Java script by Act Academy
Java script by Act AcademyJava script by Act Academy
Java script by Act Academy
 
Java script writing javascript
Java script writing javascriptJava script writing javascript
Java script writing javascript
 
JavaScript - Getting Started.pptx
JavaScript - Getting Started.pptxJavaScript - Getting Started.pptx
JavaScript - Getting Started.pptx
 
Ajax
AjaxAjax
Ajax
 
JavaScript New Tutorial Class XI and XII.pptx
JavaScript New Tutorial Class XI and XII.pptxJavaScript New Tutorial Class XI and XII.pptx
JavaScript New Tutorial Class XI and XII.pptx
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to Jquery
 
JavaScript - Part-1
JavaScript - Part-1JavaScript - Part-1
JavaScript - Part-1
 
JavaScript: Implementations And Applications
JavaScript: Implementations And ApplicationsJavaScript: Implementations And Applications
JavaScript: Implementations And Applications
 
Hsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdfHsc IT Chap 3. Advanced javascript-1.pdf
Hsc IT Chap 3. Advanced javascript-1.pdf
 
Javascript 01 (js)
Javascript 01 (js)Javascript 01 (js)
Javascript 01 (js)
 
Java script
Java scriptJava script
Java script
 

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
  • 20.