Using JavaScript to Show an Alert

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

Chapter 08: Adding Adding Interactivity Interactivity With With Behaviors Behaviors By Bill Bennett Associate Professor MSJC CIS MVC.
Introduction to JavaScript
WEB DESIGN – SEC 4-11 PART OR ALL OF THIS LESSON WAS ADAPTED FROM THE UNIVERSITY OF WASHINGTON’S “ WEB DESIGN & DEVELOPMENT I ” COURSE MATERIALS PSEUDO-CLASS.
Lesson 12- Unit L Programming Web Pages with JavaScript.
The Web Warrior Guide to Web Design Technologies
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
MSc. Publishing on WWW JavaScript. What is JavaScript? A scripting language devised by Netscape Adds functionality to web pages by: Embedding code into.
JavaScript- Introduction. What it is and what it does? What it is? It is NOT Java It is NOT Server-side programming Users can see code It is a client-side.
Multiple Tiers in Action
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Web Programming – Java Script Association of Computing Activities Computer Science and Engineering Indian Institute of Technology Kanpur.
4.1 JavaScript Introduction
Dreamweaver – Setting up a Site and Page Layouts Web Design Section 7-2 Part or all of this lesson was adapted from the University of Washington’s “Web.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
SERVER web page repository WEB PAGE instructions stores information and instructions BROWSER retrieves web page and follows instructions Server Web Server.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
Intro to Dreamweaver Web Design Section 7-1 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course.
Linking to an External Style Sheet Web Design Section 4-3 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Stylizing a Navigation Menu with CSS Web Design – Section 4-13 Part or all of this lesson was adapted from the University of Washington’s “Web Design &
DYNAMIC HTML What is Dynamic HTML: HTML code that allow you to change/ specify the style of your web pages. Example: specify style sheet, object model.
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.
COS 125 DAY 20. Agenda Assignment 8 not corrected yet Assignment 9 posted  Due April 16 New course time line Discussion on Scripts 
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
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.
JavaScript Dynamic Active Web Pages Client Side Scripting.
Event Handling (the right way). A Simple Web Page Events - Summary The web page looks like this:
Understanding JavaScript and Coding Essentials Lesson 8.
Document Object Model Nasrullah. DOM When a page is loaded,browser creates a Document Object Model of the Page.
Dreamweaver – Setting up a Site and Page Layouts Web Design Section 7-2 Part or all of this lesson was adapted from the University of Washington’s “Web.
Introduction to HTML Hypertext Mark-up Language. HTML HTML = Hypertext Mark-up Language Is just plain simple text marked up by “tags” You can create a.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
Copyright © Terry Felke-Morris Web Development & Design Foundations with HTML5 8 th Edition CHAPTER 14 KEY CONCEPTS 1 Copyright.
JQuery Fundamentals Introduction Tutorial Videos
Introduction to.
Scripting - Client-side vs. Server-side Scripting
Dreamweaver – Setting up a Site and Page Layouts
Javascript and Dynamic Web Pages: Client Side Processing
Programming Web Pages with JavaScript
Unit M Programming Web Pages with
The Box Model in CSS Web Design – Sec 4-8
Week 4: Introduction to Javascript
Intro to Dreamweaver Web Design Section 8-1
Styles with Cascading Style Sheets (CSS)
HTML & teh internets.
JavaScript Event Handling.
Unit M Programming Web Pages with
Intro to JavaScript CS 1150 Spring 2017.
JavaScript (JS) Basics
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
Building a Custom Video Player
Intro to Web Development Class A Review
Important Each team needs to submit their part of the Final Project Rubric to me in . Log into and send the powerpoint slide to
Adding Images to Your Web Page
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
Dreamweaver – Setting up a Site and Page Layouts
DHTML Javascript Internet Technology.
Your 1st Programming Assignment
DHTML Javascript Internet Technology.
Tutorial 10: Programming with javascript
Introduction to Programming and JavaScript
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
HTML and CSS Basics.
Week 5: Recap and Portfolio Site
Web Programming and Design
JavaScript 101 Lesson 8: Loops.
Presentation transcript:

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 I” Course materials

Objectives The student will: Understand how a client-side script fits within the context of an HTML page. Know some basic Javascript syntax.

Javascripting Look at this Javascript <script> function showAlert() { alert ("Hello world!"); } </script> This looks similar to the PHP code from the other day, but it has it’s own syntax. Most programming languages look a somewhat similar

Javascripting Before this function can work, we must first call the showAlert() function. JavaScript functions are called in response to events. When the page loads, or when a user clicks on, hovers over, or tabs to a specific link, these are all events. We can instruct JavaScript to watch for these events, and if or when they occur, execute the specified function. Example – Let's say we want to execute the showAlert() function after the body of the web page is fully loaded. One way to do that is to add the onload attribute to the <body> element of our web page, like this: <body onload="showAlert()">

Summary Like HTML and CSS, Javascripts are written in a specific language Different syntax Upper and lower case matters! Javascripts are defined in a <script> section in the <head> section of the HTML file. Javascripts need to be “called” to run Called in response to events (click a button, load a page, etc)

Your Turn… Download the homework for today. You will add a button to your Javascript page and customize it with CSS code. The CSS code can be either in your javascript.html file or your mystyle.css file.

Javascript file:

Javascript file: