 JavaScript is a programming language that web browsers understand. You can use it to make your web pages interactive by: Responding to user actions and.

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

KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
Introduction to JavaScript Module 1 Client Side JS Programming M-GO Sponsored By
The Web Warrior Guide to Web Design Technologies
1 Javascrbipt Intro Javascript (or js) is a programming language. Interpreted, not compiled. Not the same as java, but, similar. Use tags to use. Object-oriented.
Web Page Development Identify elements of a Web Page Start Notepad
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
Computer Science 103 Chapter 4 Advanced JavaScript.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
 Definition of HTML Definition of HTML  Tags in HTML Tags in HTML  Creation of HTML document Creation of HTML document  Structure of HTML Structure.
 As you complete the assignment, go in order as the earlier bulleted parts provide an easier opportunity for points than the later.  This project is.
1 Events Lect 8. 2 Event-driven Pages one popular feature of the Web is its interactive nature e.g., you click on buttons to make windows appear e.g.,
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
HTML.
1 Week Three: Using Scripts and Forms in HTML (Week Three) By Dr Fadi Safieddine.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
Locally Edited Animations We will need 3 files to help get us started at
10 Adding Interactivity to a Web Site Section 10.1 Define scripting Summarize interactivity design guidelines Identify scripting languages Compare common.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
DHTML: Dynamic HTML Internet Technology1. What is DHTML? A collection of enhancements to HTML ► To create dynamic and interactive websites Combination.
Intro to JavaScript. Use the tag to tell the browser you are writing JavaScript.
Adding User Interactivity – Lesson 51 Adding User Interactivity Lesson 5.
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.
Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and attributes Create.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
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.
Web Programming Basics of HTML. HTML stands for Hyper Text Mark-up Language A mark-up language is different than those that you have learned before in.
Extending HTML CPSC 120 Principles of Computer Science April 9, 2012.
Homework #4 HTML Web Assignment II ©2001 E. Kinnear.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
 HTML is hypertext markup language. It is a way for people to display their information with more complex pictures and text displays. Before HTML, messages.
JavaScript - A Web Script Language Fred Durao
Introduction to JavaScript CS101 Introduction to Computing.
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Introduction to JavaScript Objects, Properties, Methods.
4 HTML Basics Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and.
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 JavaScript can make websites more interactive, interesting, and user-friendly.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
Event Handling (the right way). A Simple Web Page Events - Summary The web page looks like this:
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
HTML-I Basic HTML Elements. HTML (Hyper Text Markup Language) HTML is a document layout and hyperlink- specification language. i.e. a language used to.
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.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
How to build a Web Page or “The things geeks never told you!”
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.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
XP Creating Web Pages with Microsoft Office
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
Section 10.1 Define scripting
Introduction to.
Section 4.1 Section 4.2 Format HTML tags Identify HTML guidelines
JavaScript is a programming language designed for Web pages.
Microsoft® Office FrontPage® 2003 Training
Project 9 Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms.
Section 17.1 Section 17.2 Add an audio file using HTML
Web Development & Design Foundations with HTML5 7th Edition
Section 10.1 YOU WILL LEARN TO… Define scripting
DHTML Javascript Internet Technology.
Of HTML, CSS and JavaScript
DHTML Javascript Internet Technology.
Computer communications
JavaScript Basics What is JavaScript?
An Introduction to JavaScript
Introduction to Programming and JavaScript
Web Programming and Design
Presentation transcript:

 JavaScript is a programming language that web browsers understand. You can use it to make your web pages interactive by: Responding to user actions and changes on the page Manipulating the web page’s contents and behavior Communicating with the user directly

How Are HTML and Javascript Different? JavaScript commands are case sensitive, regular HTML commands are not. JavaScript can be embedded into HTML code JavaScript is more focused in the user’s interaction with the website, HTML is more focused on the view. JavaScript is a programming code, HTML is not.

Create A Button In order to create a button you need to write: This is a standard HTML code and when you click the button, nothing should take place The button is just there for show and you cannot interact with it

Review Intro to Javascript. How HTML and JS are different. Create A Button ONCLICK=“Alert”

Create A Button: Breaking It Down The ‘input type’ command lets the browser know what to show, in this case a button. The ‘id’ is for the commander, in this case you, to know what the intention of the button is (you can change it to whatever you want and nothing will change). The ‘value’ is the actual name that will show on the button. Try changing it to your name and see what happens when you open it.

 Adding JavScript commands will allow you to interact with the webpage and see some action.  The easiest way is to write what we want to happen into the button tag itself is:  When you click the button, a small window should appear showing the text in parenthesis.

Adding Some Action: Breaking It Down The ‘onClick=’ is an event handler It tells the browser to run whatever’s in the quotes when the event “click” happens to the button. The ‘alert’ lets the browser know that an alert window will pop up. The parenthesis with quotations (“”) let the browser know what the alert window will say. You can change this to whatever you want.

function MsgBox (textstring) { alert ( textstring + " is best person in the world. \n" + textstring + " has the greatest smile. \n" ) } First name:

Review Create A Button: Breaking It Down Adding Some Action Adding Some Action: Breaking It Down Creating A Function

Changing the Background Color This JavaScript will add special buttons on the browser. These buttons will change the background color of the web page. You can change the script to add in what ever colors you desire. During this activity, you will be able to add as many buttons as you like.

Background Code 1 Let’s look specifically at this repetition of code that represents the buttons: The ‘name’ command serves the same purpose as the ‘id’ command The changecolor command lets the browser know that the page will change color when the event ‘click’ happens to the button.

Background Code 2 The Parenthesis that appear next to the change color command tells the browser what color to change the background to. In the model JavaScript code, the name of the button corresponded to the value, but this is not mandatory. The value can be what ever name you choose. The changecolor can be any color and is not restricted to just the seven in the rainbow (biege, tan, peach etc.).

J AVA S CRIPT FOR C HANGING THE B ACKGROUND C OLOR function changeBGC(color){ document.bgColor = color;}

 Changing the Background Color  Background Code 1  Background Code 2  Javascript for Changing the Background Code

Using a Programming Loop Some times it can be helpful to have the computer do a task over and over again. Computers never get bored so they are good at monotonous tasks. In computer science, this is called a loop because the program will go around in circles. The computer gets to an end of a section of code and then starts over at the beginning of the code. It is important to understand how to create loops.

The for loop One way to make a loop is to use a for loop. In this kind of loop, you have to tell the computer a few important variables. You have to tell it what number to start on. You have to tell it what number to increment or count by. You have to tell it when to stop. By carefully specifying the variables, a programmer can create a successful loop.

 A loop can repeat many things. A loop can ask several questions using the same code. A loop can spit out huge amounts of text. A loop can input lines from a file. Anything that a programmer wants to do over and over again can be done with a loop.

Try it function myFunction(){var x="",i;for (i=0;i "; } document.getElementById("demo").innerHTML=x;}

 Using Programming Loop  The For Loop  What a Loop Can Do  Code  Parts of the Web Page

Parts of the Web Page Each.html document should have two main parts. The first part is the heading section. This heading section starts with and ends with. The body starts with and ends with. In summary, the html document should start with this:

Merging With Proper Placement Start with your largest program code. Then, implement the body and head section of each page at a time. Be sure to test each part of the puzzle to make sure it fits right before moving on to the next piece. Try to do the whole puzzle at once makes it harder than necessary.

Step by Step Programming Each time a student adds a part to their web page or JavaScript they should test it out in their web page. Place the code and the browser side by side. You can use shortcuts to make it go faster. + + will bring down the file menu and save quickly in notepad and most applications. will reload the web browser. With practice, a programmer and save and check code in a second.

 Slide 4: Does the page contain 5 questions about the student? 20pts  Slide 9: Does the page woo with 5 or more lines of poetry? 20pts  Slide 14: Does the page give options with 5 more color buttons? 20pts  Slide 19: Does the page examples of loops that enhance the page? 20pts  Overall aesthetics: Does the page look professional? 20pts

 Using Programming Loop  Merging With Proper Placement  Step by Step Programming  Rubric and Checklist