JavaScript Lesson 1 TBE 540. Prerequisites  Before beginning this lesson, the learner must be able to… Create a basic web page using a text editor and/or.

Slides:



Advertisements
Similar presentations
COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
Advertisements

The Web Warrior Guide to Web Design Technologies
Programming TBE 540 Farah Fisher. Objectives After viewing this presentation, the learner will be able to… Given a task, create pseudocode Given pseudocode,
FORMs Lesson TBE 540. Prerequisites Before beginning this lesson, the learner must be able to… –Create basic web pages using a text editor and/or a web.
Georgia Institute of Technology JavaScript part 2 Barb Ericson Georgia Institute of Technology May 2006.
JavaScript- Processing HTML Forms. Event Handlers Begins with and ends with.
JavaScript 101 Lesson 01: Writing Your First JavaScript.
HTML Comprehensive Concepts and Techniques Second Edition Project 8 Integrating JavaScript with HTML.
16/19/2015CS120 The Information Era CS120 The Information Era Chapter 5 – Advanced HTML TOPICS: Introduction to Web Page Forms and Introductory Javascript.
JavaScript Lesson 2 TBE 540 F. Fisher. Prerequisites  Before beginning this lesson, the learner must be able to… Create and edit a web page using a text.
Logo Lesson 4 TBE Fall 2004 Farah Fisher. Prerequisites Create basic and complex shapes using Logo procedures Create Logo procedures that use variables.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
Logo Lesson 5 TBE Fall 2004 Farah Fisher. Prerequisites  Given a shape, use basic Logo commands and/or a procedure to draw the shape, with and.
CIS101 Introduction to Computing Week 09. Agenda Hand in Resume project Your questions Introduction to JavaScript This week online Next class.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
HTML Lesson 1 TBE 540 Farah Fisher. Prerequisites Before beginning this lesson, the student must be able to… Access web pages and navigate the web Access.
CIS101 Introduction to Computing Week 12 Spring 2004.
CIS101 Introduction to Computing Week 09 Spring 2004.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
HTML Lesson 5 TBE 540. Prerequisites The user must be able to… –Create basic web pages with a text editor and/or a web page editor.
Lesson 8 Creating Forms with JavaScript
1 Vendor RFI - Event User Guide. 2 Minimum System Requirements Internet connection - Modem, ISDN, DSL, T1. Your connection speed determines your access.
A detailed guide on how to set-up your printing storefront. Please Note: Storefronts are compatible with all browsers, however for optimal use of the admin.
JavaScript Form Validation
Copyright 2007, Information Builders. Slide 1 Maintain & JavaScript: Two Great Tools that Work Great Together Mark Derwin and Mark Rawls Information Builders.
Department of Information Technology e-Michigan Web Development 0 HTML Form Creation in the Vignette Content Management Application.
Event Handlers CS101 Introduction to Computing. Learning Goals Learn about event handlers Determine how events are useful in JavaScript Discover where.
CSS Class 7 Add JavaScript to your page Add event handlers Validate a form Open a new window Hide and show elements Swap images Debug JavaScript.
HTML Review HTML and JavaScript. 2 What is HTML? HTML stands for HyperText Markup Language It is the set of instructions hidden behind every web page.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
G053 - Lecture 16 Validating Forms Mr C Johnston ICT Teacher
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
Adobe GoLive Edit and FTP your web pages to a web server.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Client-Side Scripting JavaScript.  produced by Netscape for use within HTML Web pages.  built into all the major modern browsers. properties  lightweight,
Dynamic Web Pages & JavaScript. Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around.
Button and Textbox. Input  Input objects are used to obtain input from the user viewing the webpage. They allow the user to interact with the Web. 
Dr. Qusai Abuein1 Internet & WWW How to program Chap.(6) JavaScript:Introduction to Scripting.
Input & Output Functions JavaScript is special from other languages because it can accept input and produce output on the basis of that input in the same.
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
CS 111 – Oct. 4 Web design –HTML –Javascript Commitment: –This week, read sections 4.3 – 4.5.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
1 Chapter 3 – JavaScript Outline Introduction Flowcharts Control Structures if Selection Structure if/else Selection Structure while Repetition Structure.
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
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.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
Web Authoring with Dreamweaver. Unit Objectives  Be able to define keywords: HTML, HTTP (protocol), browser, web server, client/server, tag, attribute,
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
USING JAVASCRIPT TO SHOW AN ALERT Web Design Sec 6-2 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Event Handling (the right way). A Simple Web Page Events - Summary The web page looks like this:
Beginning JavaScript 4 th Edition. Chapter 1 Introduction to JavaScript and the Web.
JavaScript Events Java 4 Understanding Events Events add interactivity between the web page and the user You can think of an event as a trigger that.
JavaScript 101 Lesson 6: Introduction to Functions.
JavaScript Events. Understanding Events Events add interactivity between the web page and the user Events add interactivity between the web page and the.
JavaScript JavaScript is a programming language that web browsers understand. You can use it to make your web pages interactive by: Responding to user.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
JavaScript, Third Edition 1 SELECTION LIST Demo. JavaScript, Third Edition 2 Description This web page will edit the slection to ensure an option was.
JavaScript, Sixth Edition
CHAPTER 10 JAVA SCRIPT.
Using JavaScript to Show an Alert
Microsoft® Office FrontPage® 2003 Training
Programming Mehdi Bukhari.
T. Jumana Abu Shmais – AOU - Riyadh
Introduction to TouchDevelop
Introduction to Programming and JavaScript
JavaScript: Introduction to Scripting
Presentation transcript:

JavaScript Lesson 1 TBE 540

Prerequisites  Before beginning this lesson, the learner must be able to… Create a basic web page using a text editor and/or a web page editor. Edit the existing HTML code of a web page.

Objectives  The learner will be able to successfully add JavaScript code to a web page.  The JavaScript will produce a useful effect and enhance the page’s value to the user.

What is JavaScript?  JavaScript is a programming language. This means that the instructions you write in JavaScript will make something happen.  You can include it easily within the HTML code of a web page to customize the page.

What is JavaScript? JavaScript is related to Java and C++, but it does not need to be “compiled” (translated to binary) before it is used. JavaScript is not the same as Java.

What is JavaScript? JavaScript code is “interpreted” - the browser executes each line of code as it is encountered. JavaScript is free and many existing samples are available. (see TBE 540 HTML page for links)

What can you do with JavaScript?  Visit the links from Lesson 8 on the TBE 540 HTML page to see what can be done using JavaScript. ( 0/lesson8.html) 0/lesson8.html

 Would any of these JavaScript samples be appropriate for your web project?  Later you will learn how to add JavaScript code to your pages. What can you do with JavaScript?

How do you add JavaScript to a web page?  If you are going to add JavaScript, it is necessary to be able to edit the HTML code of a web.  If you are using a web editor and are unsure of how to edit HTML code, check HELP in your editor.

How do you add JavaScript to a web page?  At first (maybe always) you will be simply pasting in JavaScript code copied from other sources.  Sometimes you will customize the code.  You can also type the code into your HTML.

How do you add JavaScript to a web page?  When you copy or type the code, notice where it should go.  JavaScript is most commonly placed in the section of a page, but there are often parts that must go elsewhere.

JavaScript - Sample  Here is an explanation of a simple use of JavaScript - asking a question and displaying an answer.  You will try this in the Fun with Buttons! exercise.

 In this case, there will be a JavaScript function (small program) called getName() placed in the HEAD section of the HTML.  It will ask for a name and print Hi and the name. JavaScript - Sample

 Here’s what the function looks like (explanations follow): var stName="XX" function getName() { stName=prompt("Please enter your name"," ") alert("Hi, " + stName) } JavaScript - Sample

 The script tags are needed to identify this code as JavaScript. var stName="XX" function getName() { stName=prompt("Please enter your name"," ") alert("Hi, " + stName) } JavaScript - Sample

 The line beginning var sets up a variable called stName with a beginning value of XX (just to fill it up). var stName="XX" function getName () { stName=prompt("Please enter your name"," ") alert("Hi, " + stName) } JavaScript - Sample

 function getName() defines the name of the function (notice the two parentheses). var stName="XX" function getName() { stName=prompt("Please enter your name"," ") alert("Hi, " + stName) } JavaScript - Sample

 The braces { } show where the function begins and ends. var stName="XX" function getName() { stName=prompt("Please enter your name"," ") alert("Hi, " + stName) } JavaScript - Sample

 The line beginning stName= displays the message Please enter your name and waits for an entry, which will become the value of stName. var stName="XX" function getName() { stName=prompt("Please enter your name"," ") alert("Hi, " + stName) } JavaScript - Sample

 The line beginning alert displays Hi, and the value of the variable stName. var stName="XX" function getName( ) { stName=prompt("Please enter your name"," ") alert("Hi, " + stName) } JavaScript - Sample

 Something has to start the getName() function.  In the Fun with Buttons! exercise, it will be clicking on a graphic or a “form” button (more about forms in a later lesson).

JavaScript - Sample  To start a function, its name will be somewhere in the HTML: getName()  You will see this code in an IMG tag: onclick=“getName()”  When the graphic is clicked, the function starts.

JavaScript - Sample  You will also see this code between and tags :  FORMs are used to make buttons and input boxes appear on a web page.

Self Check - JS Lesson 1  True or false - JavaScript and Java are exactly the same thing.

Self Check - JS Lesson 1  True or false - JavaScript and Java are exactly the same thing.  False - Java must be “complied” (translated to binary) before running, while JavaScript runs automatically every time the web page is opened. Java is also much more powerful than JavaScript.

Self Check - JS Lesson 1  JavaScript is most often found in the _____ section of the HTML code for a web page.

Self Check - JS Lesson 1  JavaScript is most often found in the _____ section of the HTML code for a web page. {may be here, too}

Self Check - JS Lesson 1  Which of the following is the correct way to begin JavaScript?

Self Check - JS Lesson 1  Which of the following is the correct way to begin JavaScript? * * {upper and lower case must be exact}

Self Check - JS Lesson 1  Suppose you created a function called HAPPY(). What command would activate the function?  happy()  HAPPY  HAPPY()

Self Check - JS Lesson 1  Suppose you created a function called HAPPY(). What command would activate the function?  happy()  HAPPY  HAPPY() The name must be exactly the same, including upper and lower case. The parentheses must be included.

Self Check - JS Lesson 1  Which of the following commands waits for input? prompt alert

Self Check - JS Lesson 1  Which of the following commands waits for input? prompt {waits for input and Return/Enter} alert {displays message only}

Try some!  Complete the Fun with Buttons! exercise.  Go find some interesting JavaScript code and try it out.  The samples on the TBE 540 HTML page are a good place to start.