Exploring JavaScript Ch 14

Slides:



Advertisements
Similar presentations
Introducing JavaScript
Advertisements

The Web Warrior Guide to Web Design Technologies
12-Jun-15 JavaScript Language Fundamentals I. 2 About JavaScript JavaScript is not Java, or even related to Java The original name for JavaScript was.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Tutorial 10 Programming with JavaScript
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
Introduction to scripting
Introduction to PHP and Server Side Technology. Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Database-Driven Web Sites, Second Edition1 Chapter 3 INTRODUCTION TO CLIENT-SIDE SCRIPTS.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
1 JavaScript in Context. Server-Side Programming.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
Tutorial 10 Programming with JavaScript
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
Introduction.  The scripting language most often used for client-side web development.  Influenced by many programming languages, easier for nonprogrammers.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Dr. Qusai Abuein1 Internet & WWW How to program Chap.(6) JavaScript:Introduction to Scripting.
JavaScript Syntax, how to use it in a HTML document
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
05 – Java Script (1) Informatics Department Parahyangan Catholic University.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
1 Server versus Client-Side Programming Server-SideClient-Side.
1 JavaScript in Context. Server-Side Programming.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
JavaScript and AJAX 2nd Edition Tutorial 1 Programming with JavaScript.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Javascript Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
© 2010 Robert K. Moniot1 Chapter 6 Introduction to JavaScript.
Introduction to JavaScript MIS 3502, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 9/29/2016.
CGS 3066: Web Programming and Design Spring 2017
Java Script Introduction. Java Script Introduction.
Chapter 6 JavaScript: Introduction to Scripting
Tutorial 10 Programming with JavaScript
CHAPTER 5 SERVER SIDE SCRIPTING
JavaScript is a programming language designed for Web pages.
My First Web Page document.write("" + Date() + ""); To insert.
JavaScript Syntax and Semantics
PHP Introduction.
JavaScript.
Intro to PHP & Variables
Introduction to JavaScript
JavaScript Introduction
JavaScript an introduction.
Web Systems Development (CSC-215)
DHTML Javascript Internet Technology.
A second look at JavaScript
WEB PROGRAMMING JavaScript.
DHTML Javascript Internet Technology.
PHP.
T. Jumana Abu Shmais – AOU - Riyadh
Tutorial 10 Programming with JavaScript
Introduction to JavaScript
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
An Introduction to JavaScript
PHP an introduction.
CNIT 133 Interactive Web Pags – JavaScript and AJAX
Presentation transcript:

Exploring JavaScript Ch 14 JavaScript brings a dynamic functionality to your websites

JavaScript and HTML Text A typical HTML 4.01 “Hello World” document using JavaScript might look like Example14-1. Example 14-1. “Hello World” displayed using JavaScript <html> <head><title>Hello World</title></head> <body> <script type="text/javascript”> document.write("Hello World”) </script> <noscript> Your browser doesn't support or has disabled JavaScript </noscript> </body> </html>

Using Scripts Within a Document Head you can put it in the <head> section Old and non Standard Browsers Other scripting languages Microsoft’s VBScript, which is based on the Visual Basic programming language and Tcl, a rapid prototyping language

Including JavaScript Files In addition to writing JavaScript code directly in HTML documents, you can include files of JavaScript code either from your website or from anywhere on the Internet. The syntax for this is <script type="text/javascript" src="script.js"></script> To pull a file in from the Internet, use <script type="text/javascript" src=http://someserver.com/script.js></script>

Debugging JavaScript Errors

Using Comments // This is a comment /* This is a section of multiline comments that will not be interpreted */

Semicolons Not generally required by JavaScript if you have only one statement on a line

Variables, String Variables No particular character identifies a variable in JavaScript as the dollar sign does in PHP JavaScript string variables should be enclosed in either single or double quotation marks, like this: greeting = "Hello there” warning = 'Be careful’

Operators, Arithmetic Operators JavaScript mathematical operators look a lot like plain arithmetic

Assignment Operators

Comparison Operators

Logical Operators do not include and and or equivalents to && and ||, and there is no xor operator

Variable Typing

Functions, Global Variables As with PHP, JavaScript functions are used to separate out sections of code that perform a particular task see 14-9 Global variables are ones defined outside of any functions (or within functions, but defined without the var keyword).

Local Variables Parameters passed to a function automatically have local scope see example 14-10, 14-11 and 14-12

The Document Object Model Document Object Model or DOM. This breaks down the parts of an HTML document into discrete objects, each with its own properties and methods, and each subject to JavaScript’s control.

DOM Object Hierarchy