THE BIG PICTURE. How does JavaScript interact with the browser?

Slides:



Advertisements
Similar presentations
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
Advertisements

INFM 603: Information Technology and Organizational Context Jimmy Lin The iSchool University of Maryland Thursday, September 19, 2013 Session 3: JavaScript.
Javascript Introduction Norman White Material is from w3schools.com Go there to run examples interactively.
HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript.
ISP 121 Algorithmsand Computer Programming. Why Know Simple Programming?  You can create powerful macros in Access / Excel / Word / ??? to manipulate.
MIS 3200 – Unit 4 Complex Conditional Statements – else if – switch.
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
Computer Science 103 Chapter 3 Introduction to JavaScript.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
The If/Else Statement, Boolean Flags, and Menus Page 180
1 Lab Session-III CSIT-120 Spring 2001 Revising Previous session Data input and output While loop Exercise Limits and Bounds GOTO SLIDE 13 Lab session.
CIS101 Introduction to Computing Week 12 Spring 2004.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Madlib-Input, Strings, and Lists in Scratch Barb Ericson Georgia Tech June 2011.
Introduction to JavaScript for Python Programmers
* Just the gist? * Lots of details? * Specific steps? * What language ?
Microsoft ® Office Word 2007 Training Mail Merge II: Use the Ribbon and perform a complex mail merge [Your company name] presents:
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
Title, meta, link, script.  The title looks like:  The tag defines the title of the document in the browser toolbar.  It also: ◦ Provides a title for.
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.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
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.
Dynamic Web Pages & JavaScript. Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around.
DHTML AND JAVASCRIPT Genetic Computer School LESSON 5 INTRODUCTION JAVASCRIPT G H E F.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (there is an audio component to this eLesson) © Dr.
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
1 JavaScript
XP Tutorial 8 Adding Interactivity with ActionScript.
CSCI-100 Introduction to Computing
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
1 Chapter 3 – JavaScript Outline Introduction Flowcharts Control Structures if Selection Structure if/else Selection Structure while Repetition Structure.
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 Overview Developer Essentials How to Code Language Constructs The DOM concept- API, (use W3C model) Objects –properties Methods Events Applications;
Basic Conditions. Challenge: ● Ask the user his/her name ● If it’s “Wally,” jeer him ● Pause video and try on your own.
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.
PHP Form Processing * referenced from
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
IST 210: PHP LOGIC IST 210: Organization of Data IST210 1.
JavaScript 101 Lesson 6: Introduction to Functions.
Madlib-Input, Strings, and Lists in Scratch Barb Ericson Georgia Tech.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Introduction to Scratch We will be using the Scratch Environment today, so please log in to the Scratch website (scratch.mit.edu)
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
Learning to use a ‘For Loop’ and a ‘Variable’. Learning Objective To use a ‘For’ loop to build shapes within your program Use a variable to detect input.
PHP using MySQL Database for Web Development (part II)
Madlib-Input, Strings, and Lists in Scratch
Spanish Mad libs with Scratch
JavaScript Fundamentals
Introduction to JavaScript
JavaScript, continued.
PHP.
T. Jumana Abu Shmais – AOU - Riyadh
Class Examples.
Training & Development
For this assignment, copy and past the XHTML to a notepad file with the .html extension. Then add the code I ask for to complete the problems.
Tutorial 10: Programming with javascript
Introduction to JavaScript
How to allow the program to know when to stop a loop.
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
Intro to Programming (in JavaScript)
Presentation transcript:

THE BIG PICTURE

How does JavaScript interact with the browser?

What sort of things can we do with JavaScript? We can use JavaScript to process and check data entered in forms.

What sort of things can we do with JavaScript? We can use JavaScript to store and read information in “cookies.” Cookies are bits of data that are stored in the browser folder on the user’s local computer. They are used to track users (creepy) and are also used to customize content (convenient).

What sort of things can we do with JavaScript? We can use JavaScript to dynamically show and hide content.

What sort of things can we do with JavaScript? We can use JavaScript to dynamically access any part of the document.

Loops in JavaScript. In Scratch we used loops to repeat a series of instructions for a fixed period of time. In JavaScript, we can do the same thing with a “for” loop.

Conditional statements in JavaScript. In Scratch we use if and if-else statements to check if something was true. In JavaScript, we can do the same thing with if and if-else statements.

Variables in JavaScript. In Scratch we use variables as information containers. They can hold numbers or letters (strings). In JavaScript we create variables by giving them a name.

EXERCISE

1. Download the source files from TLEARN2: madlib.html and madlib.css

2. Link your HTML file to an external JavaScript file by adding the line in the.

3. Create a new file called madlib.js, and add the following code. Test by loading the page. Use your name instead of my name for the function. For example: zackFunction, ellenFunction.

4. Now, modify the page so the user will have to answer a question when the page loads. Your output should look like this: REFERENCE

5. NEXT: Ask the user for their name, and then greet them by name. From now on, these reference code blocks will show you the building blocks, will not give you the exact answer about how your code should look. Your output should look like this: REFERENCE

6. NEXT: Berate the user if their name is too long. Also, remember that you can find out the length of a string with: variableName.length Your output should look like this: REFERENCE

7. NEXT: Ask the user their name and then change the name of the author on the madlib page. (See following slide for hints.)

REFERENCE FOR PREVIOUS SLIDE