JAVASCRIPT HOW TO PROGRAM -2

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

The Web Warrior Guide to Web Design Technologies
Computer Science 103 Chapter 3 Introduction to JavaScript.
Computer Science 103 Chapter 4 Advanced JavaScript.
آموزش طراحی وب سایت جلسه دهم – جاوا اسکریپت 1 تدریس طراحی وب برای اطلاعات بیشتر تماس بگیرید تاو شماره تماس: پست الکترونیک :
JAVASCRIPT HOW TO PROGRAM -2 DR. JOHN P. ABRAHAM UTPA.
WEB DESIGN AND PROGRAMMING Introduction to Javascript.
Introduction to JavaScript Dr. John P. Abraham University of Texas – Pan American.
CSC318 – DYNAMIC WEB APPLICATION DEVELOPMENT
1 Week Three: Using Scripts and Forms in HTML (Week Three) By Dr Fadi Safieddine.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
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.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
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.
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.
COMP403 Web Design JAVA SCRİPTS Tolgay KARANFİLLER.
1 JavaScript Part 3. Functions Allow the user to decide when a particular script should be run by the browser in stead of running as long as the page.
CIS 375—Web App Dev II JavaScript I. 2 Introduction to DTD JavaScript is a scripting language developed by ________. A scripting language is a lightweight.
Javascript JavaScript is what is called a client-side scripting language:  a programming language that runs inside an Internet browser (a browser is also.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
CIS 3.5 Lecture 2.3 "Introduction to JavaScript".
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 14 Key Concepts 1 Copyright © Terry Felke-Morris.
JavaScript Introduction inf385t Semantic Web 2/20/2006.
1 Lesson 6 Introducing JavaScript HTML and JavaScript BASICS, 4 th Edition.
 2001 Prentice Hall, Inc. All rights reserved. Outline 1 JavaScript.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
JAVA SCRIPT HOW TO PROGRAM DR. JOHN ABRAHAM PROFESSOR UTPA SOME SLIDES FROM W3SCHOOLS.
Build in Objects In JavaScript, almost "everything" is an object.
Java Script Introduction. Java Script Introduction.
Moving away from alert() Using innerHTML Using an empty div section
CHAPTER 10 JAVA SCRIPT.
JavaScript Tutorial Second lecture 22/2/2016.
Using JavaScript to Show an Alert
Abstraction and Functions
HTML & teh internets.
JavaScript is a programming language designed for Web pages.
Project 9 Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms.
Section 17.1 Section 17.2 Add an audio file using HTML
Functions Comp 205 Fall ‘17.
Web Development & Design Foundations with HTML5 7th Edition
Exploring JavaScript Ch 14
WEB APPLICATION PROGRAMMING
JavaScript Syntax and Semantics
Javascript Short Introduction By Thanawat Varintree,
Chapter 6: Conditional Statements and Loops
BY: SITI NURBAYA ISMAIL FACULTY of COMPUTER and MATHEMATICAL SCIENCES
JavaScript and Ajax (Expression and Operators)
DHTML Javascript Internet Technology.
Javascript الجافا سكربت هي لغة برمجه اذا جاز التعبیر تلعب دور حیوي وفعال في صفحات الویب من خلال القیام بوظائف قد تكون خارجیة او داخلیة بل لنكن اكثر دقة.
Your 1st Programming Assignment
يمكن استدعاء الكود الوظيفي عند حدث معين أو عند استدعاء الكود الوظيفي .
Javascript: variables and parameters
DHTML Javascript Internet Technology.
يمكن استدعاء الكود الوظيفي عند حدث معين أو عند استدعاء الكود الوظيفي .
The Web Wizard’s Guide To JavaScript
Introduction to JavaScript
JavaScript onLoad arrays
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.
Chapter 7 - JavaScript: Introduction to Scripting
Tutorial 10: Programming with javascript
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
Software Engineering for Internet Applications
Introduction to JavaScript
Week 5: Recap and Portfolio Site
This is an introduction to JavaScript using the examples found at the CIS17 website. In previous examples I specified language = Javascript, instead of.
Presentation transcript:

JAVASCRIPT HOW TO PROGRAM -2 DR. JOHN P. ABRAHAM UTPA

Script development process Requirement analysis Goal – Audience Design Sketch the page – Site map – outline content - pseudocode Implementation Coding Support & maintenance

Script statements in head User defined functions Global variables Statements that preload images for use in rollover effects

Keep an HTML outline <HTML> <head> <title> Array example </title> <script language ="javaScript"> </script> </head> <body> </body> </HTML>

InputBox <HTML> <head> <title> Ask user name </title> <script language ="javaScript"> var visitor = prompt("What is your name?", " ") </script> </head> <body> </body> </HTML>

Using input <HTML> <head> <title> Ask user name </title> <script language ="javaScript"> var visitor = prompt("What is your name?", “Default Name ") </script> </head> <body> <script language ="javascript"> document.write("<h1> Hello, ", visitor, "! </h1>") </body> </HTML>

Onload (event) <HTML> <head> <title> Ask user name </title> <script language ="javaScript"> var visitor = prompt("What is your name?", " ") </script> </head> <body onLoad="alert('Welcome! '+visitor)"> </body> </HTML>

Alert Box with 2 lines <HTML> <head> <title> Ask user name </title> <script language ="javaScript"> var visitor = prompt("What is your name?", " ") </script> </head> <body onLoad="alert('Welcome! \n'+visitor)"> </body> </HTML>

Function with return value <html> <head> <script type="text/javascript"> function product(a,b) { return a*b; } </script> </head> <body> document.write(product(4,3)); <p>The script in the body section calls a function with two parameters (4 and 3).</p> <p>The function will return the product of these two parameters.</p> </body> </html>

Looping <HTML> <head> <title> Nested Loop </title> <script language ="javaScript"> var i=1, j; while (i <= 12) {document.writeln("<br>Table for ",i, "<br>"); for (j=1; j <=16; j++) document.writeln(i, " x ", j, " = ", i*j,"<br>"); i++ } </script> </head> <body> </body> </HTML>

Looping & Table <HTML> <head> <title> Nested Loop </title> <script language ="javaScript"> var i=1, j; while (i <= 12) {document.writeln("<table border='1'>"); document.writeln("<br><tr><td>Table for ",i, "</td></tr>"); for (j=1; j <=16; j++) document.writeln("<tr><td>",i, " x ", j, " = ", i*j,"</td></tr>"); document.writeln("</table>"); i++ } </script> </head> <body> </body> </HTML>

Assignment Help <HTML> <HEAD> <TITLE>Future value of an investment</TITLE> <SCRIPT LANGUATE = "JavaScript"> var age, initial, deposit, rate; getdata(); if (rate >1) rate = rate/100; //convert rate to fraction just in case. document.writeln( age," ", initial," ", deposit," ", rate); function getdata() { document.writeln("<BR> This program calculates your total assets at retirment (age 65)"); document.writeln("<BR> given initial deposit, amount of deposit every 30 days, "); document.writeln("<BR> interest rate and your current age."); document.writeln("<BR>---------------------- data entry ---------------------------<BR>"); age=parseInt(window.prompt("How old are you (must be below 65)?----------------> ")); initial=parseFloat(window.prompt( "What is your initial deposit?----------------------> ")); deposit=parseFloat(window.prompt( "Amount you agree to deposit every 30 days?---------> ")); rate=parseFloat(window.prompt( "What would be your expectation of interest or growth? ")); return initial, deposit, rate, age; } </Script> </HEAD> </HTML>