Javascript Overview. What is Javascript? May be one of the most popular programming languages ever Runs in the browser, not on the server All modern browsers.

Slides:



Advertisements
Similar presentations
JavaScript Part 6. Calling JavaScript functions on an event JavaScript doesn’t have a main function like other programming languages but we can imitate.
Advertisements

HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
Lesson 12- Unit L Programming Web Pages with JavaScript.
The Web Warrior Guide to Web Design Technologies
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
Lesson 19. JavaScript errors Since JavaScript is an interpreted language, syntax errors will usually cause the script to fail. Both browsers will provide.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
JavaScript Introduction
CSC 330 E-Commerce Teacher Ahmed Mumtaz Mustehsan Ahmed Mumtaz Mustehsan GM-IT CIIT Islamabad GM-IT CIIT Islamabad CIIT Virtual Campus, CIIT COMSATS Institute.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
What is Java Script? An extension to HTML. An extension to HTML. Allows authors to incorporate some functionality in their web pages. (without using CGI.
CHAPTER 4 Java Script อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
JavaScript Introduction 1. What is Java Script ? JavaScript is a client-side scripting language. A scripting language is a lightweight programming language.
JavaScript - A Web Script Language Fred Durao
Lecture 10 JavaScript: DOM and Dynamic HTML Boriana Koleva Room: C54
JavaScript - Basic Concepts Prepared and Presented by Hienvinh Nguyen, Afshin Tiraie.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
By Tharith Sriv. To write a web page you use: HHTML (HyperText Markup Language), AASP (Active Server Page), PPHP (HyperText Preprocessor), JJavaScript,
JavaScript. JavaScript is the programming language of HTML and the Web. Easy to learn One of the 3 languages of all developers MUST learn: 1. HTML to.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
HTML JAVASCRIPT. CONTENTS Javascript Example NOSCRIPT Tag Advantages Summary Exercise.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
HTML Overview Part 5 – JavaScript 1. Scripts 2  Scripts are used to add dynamic content to a web page.  Scripts consist of a list of commands that execute.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
Understanding JavaScript and Coding Essentials Lesson 8.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
JavaScript 101 Lesson 6: Introduction to Functions.
JavaScript Tutorial. What is JavaScript JavaScript is the programming language of HTML and the Web Programming makes computers do what you want them to.
Introduction to Web Site Development Department of Computer Science California State University, Los Angeles Lecture 9: JavaScript.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
Servlets What is a Servlet?
Introduction to.
Build in Objects In JavaScript, almost "everything" is an object.
Programming Web Pages with JavaScript
JavaScript Event Handling.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Intro to JavaScript CS 1150 Spring 2017.
JAVA Script : Functions Ashima Wadhwa
Barb Ericson Georgia Institute of Technology May 2006
Introduction to Web programming
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
Getting web pages First we need to get the webpage by issuing a HTTP request. The best option for this is the requests library that comes with Anaconda:
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
Introduction to JavaScript
JavaScript Introduction
DHTML Javascript Internet Technology.
A second look at JavaScript
DHTML Javascript Internet Technology.
Functions, Regular expressions and Events
JavaScript What is JavaScript? What can JavaScript do?
JavaScript MCS/BCS.
Javascript.
JavaScript What is JavaScript? What can JavaScript do?
Training & Development
E-commerce Applications Development
Introduction to JavaScript
Tutorial 10: Programming with javascript
Introduction to Web programming
Presentation transcript:

Javascript Overview

What is Javascript? May be one of the most popular programming languages ever Runs in the browser, not on the server All modern browsers support javascript Easy to learn Is NOT Java; completely different in concept and design

What Can You Do? Change html content yjs_intro_inner_html Change html attributes yjs_intro_lightbulb Validate data in the browser yjs_intro_validate

Where to place Javascript Can be placed in the body OR head; best to put in a separate.js file. Keep your javascript all in one place In html code, must put between tags document.getElementById("demo").innerHT ML = "My First JavaScript";

Head and Body Examples Head Example: whereto_head Body Example: whereto_body External File: whereto_external

External File Advantages Separates html and code Makes html and Javascript easier to read and maintain Cached Javacript files can speed up page loads

Display Possibilities Write to an alert box using window.alert() Write to html output using document.write() Write to an html element using innerHTML Write into the browser console using console.log()

Using innerHTML Use the document.getElementById(id) method. – Remember when we covered the DOM? The id attribute defines the html element; the innerHTML property defines the html content yjs_output_dom

Language Syntax, Statements, Variables, Operators, Datatypes

Functions A block of code designed to perform a particular task Executed when something invokes it Defined bwith the function keyword, followed by a name, followed by parentheses() The parentheses may include parameter names followed by commas: (parameter1, parameter2) The code to be executed is included in {} The functions often compute a return value, which can be returned to the caller ion_return

Objects Objects are variables too but can contain many values and functions

Events Things that happen to html elements (i.e., the browser initiates or the user initiates) Javascript can “react” to on these events to do something you want done Html allows event handler attributes, with javascript code, to be added to html elements onclick1