JavaScript 101 Lesson 01: Writing Your First JavaScript.

Slides:



Advertisements
Similar presentations
Introducing JavaScript
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Introduction to JavaScript
The Web Warrior Guide to Web Design Technologies
Lesson 4: Formatting Input Data for Arithmetic
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
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.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
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.
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.
Basic XHTML Module 2: XHTML Basics LESSON 1. Module 2: XHTML Basics LESSON 1 Lesson Overview In this lesson, you will learn to:  Write XHTML code using.
Javascript and the Web Whys and Hows of Javascript.
4.1 JavaScript Introduction
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Today’s Topic Language of web page - HTML (Hypertext Markup Language)
Images in HTML PowerPoint How images are used in HTML.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
OBJECTIVES  What is HTML  What tools are needed  Creating a Web drive on campus (done only once)  HTML file layout  Some HTML tags  Creating and.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Computing Theory: HTML Year 11. Lesson Objective You will: o Be able to define what HTML is - ALL o Be able to write HTML code to create your own web.
HTML Hyper Text Markup Language. What is an HTML File?  HTML stands for Hyper Text Markup Language  An HTML file is a text file containing small markup.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
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. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
Tutorial 10 Programming with JavaScript
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
YEAR 8 – WEB DESIGN IN HTML Lesson 2. STARTER Use the internet to find out what JavaScript is? Use ‘Microsoft Word’ to write down your list.
HTML ( HYPER TEXT MARK UP LANGUAGE ). What is HTML HTML describes the content and format of web pages using tags. Ex. Title Tag: A title It’s the job.
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.
CPSC 203 Introduction to Computers Lab 66 By Jie Gao.
JavaScript Syntax, how to use it in a HTML document
An Introduction to JavaScript By: John Coliton Tuesday, November 10, 1998 Center for Teaching and Learning.
Introduction to JavaScript CS101 Introduction to Computing.
Overview of Form and Javascript fundamentals. Brief matching exercise 1. This is the software that allows a user to access and view HTML documents 2.
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
JavaScript Introduction.  JavaScript is a scripting language  A scripting language is a lightweight programming language  A JavaScript can be inserted.
Introduction into JavaScript Java 1 JavaScript JavaScript programs run from within an HTML document The statements that make up a program in an HTML.
1 JavaScript in Context. Server-Side Programming.
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.
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
HTML tags and attributes By: Dennis Champagne. List of tags.
External Style Sheets Exploring Computer Science – Lesson 3-6.
Chapter 1 Introduction to JavaScript JavaScript, Third Edition.
Basic HTML. Lesson Overview In this lesson, you will learn to:  Write HTML code using a text editor application such as Notepad.  View Web pages created.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Beginning JavaScript 4 th Edition. Chapter 1 Introduction to JavaScript and the Web.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Creating Web Pages with Links, Images, and Embedded Style Sheets
JavaScript 101 Lesson 6: Introduction to Functions.
JavaScript and AJAX 2nd Edition Tutorial 1 Programming with JavaScript.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
HTML is the language that allows text and graphics to be displayed as Web pages. It is a set of special codes, called tags, that tells a browser application.
Intro to JavaScript CS 1150 Spring 2017.
Donna J. Kain, Clarkson University
Introduction to JavaScript
Introduction to JavaScript
Lesson 2: Input and Variables
Tutorial 10 Programming with JavaScript
An Introduction to JavaScript
Introduction to JavaScript
JavaScript 101 Lesson 8: Loops.
Presentation transcript:

JavaScript 101 Lesson 01: Writing Your First JavaScript

Topics Use the tag Including JavaScript code in a Web page Hiding your JavaScript code from older browsers Using document.write to display text in a Web document

Topics (cont.) Using embedded HTML to format output Displaying the date and time using the Date object Using comments to document code

The script tag JavaScript code is embedded in HTML documents Use script tag for JavaScript code JavaScript code goes here Similar format to other html tags

Where to put your JavaScript Script tag can be inserted into body or head of your document Most examples for CIS101 will go in the body of your document

Hiding JavaScript from Old Browsers JavaScript is a recent addition to Web pages Browsers that pre-date JavaScript can’t run its code Can use special symbols to hide JavaScript code from old browsers (this is less important as time goes on)

JavaScript hiding code Insert this code in the body of your HTML document:

Using document.write document.write is your first JavaScript statement Syntax: document.write(“text goes here”); Text within quotes will be displayed Semi-colon is optional

document.write cont. “dot notation” common to object based and object oriented languages dot means “belongs to” write method “belongs to” the document object

Comments Text inside a code file not intended to be executed is called a comment Comments are useful in order to include information or explanations Designated with either // this is a one line comment /* this is the start of a comment until this symbol is encountered */

In the lab Your first JavaScript will use document.write Open Notepad and create a new HTML document named lesson0101.html Enter code from p. 1-4 exactly as you see it Save the file and open it using either Internet Explorer or Netscape

Mistakes and JavaScript If your output does not match p. 1-5 you made a mistake In programming tiny mistakes make big problems You must eliminate all mistakes before code will run (called debugging)

Add more code Common development method in programming is to try out a little piece of code, get it working, then start adding more code Add code that writes in color (p. 1-7)

Add the Date Computers keep an internal clock that with the current date and time Use Date() to include the date on your page Add the following code: document.write(“Today is “,Date(),” ”);

Student Modifications Each lab exercise starts with code you enter and run Then you will add modifications and additions To your lesson0101 file add the following: Display your favorite singer or band Display your address in your favorite color Display your favorite movie Include a comment in your code file

Lesson Summary The script tag How to hide JavaScript from old browsers Used document.write to display text Used HTML embedded within JavaScript to format text for display Used comments to document your code Added the Date object to display the current date and time