JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC Introduction to JavaScript Syntax Instructor: Joseph DiVerdi, Ph.D., MBA.

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

Introduction to PHP Dr. Charles Severance
Chapter 1: Computer Systems
Programming with Java. Problem Solving The purpose of writing a program is to solve a problem The general steps in problem solving are: –Understand the.
C++ Basics Variables, Identifiers, Assignments, Input/Output.
IT151: Introduction to Programming
Introduction to C Programming
Chapter 1: Introduction
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
The Java Programming Language
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Outline Java program structure Basic program elements
 2007 Pearson Education, Inc. All rights reserved Introduction to C Programming.
Chapter 1 Introduction. © 2004 Pearson Addison-Wesley. All rights reserved1-2 Outline Computer Processing Hardware Components Networks The Java Programming.
Introduction to C Programming
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Introduction to JavaScript Form Verification - Fort Collins, CO Copyright © XTR Systems, LLC Verifying Submitted Form Data with JavaScript Instructor:
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
Chapter 9 Interactive Multimedia Authoring with Flash - Introduction to Programming “Computers and Creativity” Richard D. Webster, COSC 109 Instructor.
Prepared by Uzma Hashmi Instructor Information Uzma Hashmi Office: B# 7/ R# address: Group Addresses Post message:
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
© 2006 Pearson Education Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science A 2nd Edition.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Java Language and SW Dev’t
Using Embedded JavaScript Fort Collins, CO Copyright © XTR Systems, LLC Embedding JavaScript In HTML Instructor: Joseph DiVerdi, Ph.D., MBA.
CPTR 124 Review for Test 1. Development Tools Editor Similar to a word processor Allows programmer to compose/save/edit source code Compiler/interpreter.
System development with Java Lecture 2. Rina Errors A program can have three types of errors: Syntax and semantic errors – called.
© 2006 Pearson Education 1 Obj: cont 1.3 and 1.4, to become familiar with identifiers and to understand how programming languages work HW: p.51 #1.8 –
1 Computer Systems -- Introduction  Chapter 1 focuses on:  the structure of a Java application  basic program elements  preparing and executing a program.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
The Java Programming Language
CSC204 – Programming I Lecture 4 August 28, 2002.
Introduction. Objectives An overview of object-oriented concepts. Programming and programming languages An introduction to Java 1-2.
Introduction to JavaScript Gordon Tian
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
RegExp. Regular Expression A regular expression is a certain way to describe a pattern of characters. Pattern-matching or keyword search. Regular expressions.
C Derived Languages C is the base upon which many build C++ conventions also influence others *SmallTalk is where most OOP comes Java and Javascript have.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
USING UNITY JAVASCRIPT. CONVENTIONS AND SYNTAX IN JAVASCRIPT Case Sensitivity All keywords like var or function must be in lowercase. All variable names,
Chapter 1: Introduction Java Programming Language How the Java Virtual Machine Works (compiling, etc…) Update by: Dan Fleck Coming up: The Java Programming.
Java The Java programming language was created by Sun Microsystems, Inc. It was introduced in 1995 and it's popularity has grown quickly since A programming.
_______________________________________________________________________________________________________________ PHP Bible, 2 nd Edition1  Wiley and the.
Lecture 2 Software Concepts Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung Institute of Technology.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
1 Problem Solving b The purpose of writing a program is to solve a problem b The general steps in problem solving are: Understand the problemUnderstand.
 2000 Deitel & Associates, Inc. All rights reserved. Outline 8.1Introduction 8.2A Simple Program: Printing a Line of Text in a Web Page 8.3Another JavaScript.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
White Space Spaces, blank lines, and tabs are collectively called white space and are used to separate words and symbols in a program Extra white space.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
Introduction to JavaScript Fort Collins, CO Copyright © XTR Systems, LLC Introduction to JavaScript Programming Instructor: Joseph DiVerdi, Ph.D., MBA.
CSU - DCE Introduction to CSS CSS Text - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Text Control Instructor: Joseph.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
Introduction to Java Programming by Laurie Murphy Revised 09/08/2016.
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
Chapter 6 JavaScript: Introduction to Scripting
Working with Java.
CS170 – Week 1 Lecture 3: Foundation Ismail abumuhfouz.
Variables and Arithmetic Operators in JavaScript
Chapter 19 JavaScript.
Variables and Arithmetic Operators in JavaScript
Introduction to Java Programming
Chapter 1: Computer Systems
Units with – James tedder
Units with – James tedder
JavaScript Reserved Words
Focus of the Course Object-Oriented Software Development
Programming Introduction to C++.
Chap 2. Identifiers, Keywords, and Types
Presentation transcript:

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC Introduction to JavaScript Syntax Instructor: Joseph DiVerdi, Ph.D., MBA

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC Tricky Language Looks About as Complicated as BASIC Is Much More Complex Than BASIC –Use of Objects –Arguments to Functions Requires Careful Understanding of Argument Passing by–value by–reference Lots of Non-intuitive Aspects Lots of Very Tricky Details

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC Object -Oriented Language Different style of programming –Traditional Programming called Function-Oriented Data & Functions –Useful Modern way of Thinking About Programs Some Definitions: object: a data structure with a collection of behaviors that can be performed on it method: a behavior performed on an object class: a definition of methods inherit: receive definitions instance: individual representative of a category

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC Example Syntax Two Parts to Most JavaScript: –Function Definitions Tell the Browser What to Do Not required –References To Those Functions Required

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC JavaScript Syntax This Will Be a Synopsis of Important Topics See Part I in Textbook –For Additional Details –aka Chapters 2-11

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC JavaScript Syntax JavaScript is a cAsE-sEnSiTtiVe Language –Many Items are Defined in the Language Use the Case as Defined –You Will Define Many of Your Own Items Use the Case You Define HTML is a case-INSENSITIVE Language –Keep in Mind Where HTML Ends, JavaScript Starts, & vice versa Bad News –Some Browser Versions are Case-Insensitive Don't Yield to the Temptation...

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC JavaScript Syntax JavaScript Identifiers are –Variable Names –Function Names –Label Names

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC JavaScript Syntax Identifiers are Composed of Any Number of Legal Characters –Letters (a-z, A-Z) –Digits (0-9) –Underscore ( _ ) –Dollar sign ($) The First Character Must Not Be a Digit In Certain Early Versions –The $ Character is Not Allowed

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC Programming Suggestions Use All Lower Case For Your Identifiers –It's Easier To Remember Write Out Words in Identifiers –It's Easier To Read (& Maintain) Use Underscore to separate Words –Very Readable for You –Very Readable for ESL Programmers

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC Programming Suggestions For Example: name_first name_last address_ address_street address_city,... Or For Helpful Sorting: _01_name_first _02_name_last _03_address_ _04_address_street _05_address_city,...

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC JavaScript Syntax Keywords –The Following Keywords are Part of the JavaScript Language & May Not be Used as Identifiers: break case continue default delete do else export false for function if import in new null return switch this true typeof var void while with –The Following Words are Reserved & May Not be Used as Identifiers: catch class const debugger enum extends finally super throw try –Keywords are Always Used in Lower Case

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC JavaScript Syntax Tokens –Keyword –Variable Name –Function Name –Number –Regular Expression Pattern –Operators

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC JavaScript Syntax Whitespace –JavaScript Ignores Whitespace Space Tab Return –Whitespace is Located Between Tokens –You Should Use Whitespace To Format Your Code –In a Readable Fashion

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC JavaScript Syntax Semicolons –A JavaScript Statement Ends With a Semicolon –When a Statement is Ends with Newline The Terminating Semicolon May Be Omitted –Danger - Don't omit it! –Funny Rule About Line Breaks "You Cannot Read a Statement Across Two Lines if The First Line Can Be Interpreted as a Legal Statement on Its Own." –Subtle, non-intuitive, error prone –Always Terminate Statements With Semicolon –Use Your Editor's Line Wrapping For Readability

JavaScript Syntax Fort Collins, CO Copyright © XTR Systems, LLC JavaScript Syntax Comments –JavaScript Supports Both C & C++ Comments –C Comment Text, On One or More Lines, Between /* and */ /* Here is a comment Here is some more of the same comment */ –C++ Comment Text Between // & The End of The Current Line // Here is a comment // Here is another comment // Yes, this is yet another comment