1 HTML & teh internets. 2 Contents JavaScript CSS Goal: Integrating knowledge.

Slides:



Advertisements
Similar presentations
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
Advertisements

© Anselm SpoerriInfo + Web Tech Course Information Technologies Info + Web Tech Course Anselm Spoerri PhD (MIT) Rutgers University
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Introduction to Scripting.
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.
Web Infrastructure Week 3 INFM 603. The Key Ideas Questions Structured Programming Modular Programming Data Structures Object-Oriented Programming.
CIS101 Introduction to Computing Week 09. Agenda Hand in Resume project Your questions Introduction to JavaScript This week online Next class.
Javascript II Expressions and Data Types. 2 JavaScript Review programs executed by the web browser programs embedded in a web page using the script element.
CIS101 Introduction to Computing Week 09 Spring 2004.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Introduction to JavaScript for Python Programmers
Introduction to JavaScript. Aim To enable you to write you first JavaScript.
Introduction to scripting
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
JavaScript Programming Basics Chapter What is Programming?
Forms and Java script. Forms The graphical user interface -textbox, radio, button, textarea, checkbox… The processing script –CGI scripts, Perl script,
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
Javascript and Basic Programming Concepts. What is a Program? A program is a specific set of instructions written in a computer language to perform a.
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.
SYST Web Technologies SYST Web Technologies Lesson 6 – Intro to JavaScript.
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
JavaScript Part 1.
JavaScript Lecture 6 Rachel A Ober
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Week 9 PHP Cookies and Session Introduction to JavaScript.
Integrating JavaScript and HTML5 HTML5 & CSS 7 th Edition.
IST 210: PHP BASICS IST 210: Organization of Data IST210 1.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Chapter 4 JavaScript and Dynamic Web pages. Objectives Static Web pages Dynamic Web pages JavaScript Variables Assignments. JavaScript Functions –(prompt(“”,””)
Objective Static vs. Dynamic Web pages. Variables. Assignments. JavaScript Hierarchy of Objects JavaScript Functions (prompt(“”,””) Document.write(“”)
1 JavaScript 1. 2 Java vs. JavaScript Java –Is a high level programming language –Is platform independent –Runs on a standardized virtual machine.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Topic: An Introduction to JavaScript - from Beginning JavaScript by Wilton (WROX)
ALBERT WAVERING BOBBY SENG. Week 4: JavaScript  Quiz  Announcements/questions.
1 JavaScript
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.
Fluency with Information Technology INFO100 and CSE100 Katherine Deibel Katherine Deibel, Fluency in Information Technology1.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
4. Javascript M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer (C-307) Desain.
1 CSC160 Chapter 7: Events and Event Handlers. 2 Outline Event and event handlers onClick event handler onMouseOver event handler onMouseOut event handler.
JavaScript Challenges Answers for challenges
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".
JavaScript. JavaScript Introduction JavaScript is the world's most popular programming language. It is the language for HTML and the web, for servers,
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 2: Introduction to IS2803 Rob Gleasure
JavaScript and Ajax (JavaScript Functions) Week 5 Web site:
Dr. Abdullah Almutairi Spring PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages. PHP is a widely-used,
OVERVIEW OF CLIENT-SIDE SCRIPTING
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
JavaScript Tutorial. What is JavaScript JavaScript is the programming language of HTML and the Web Programming makes computers do what you want them to.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
JavaScript Tutorial First lecture 19/2/2016. Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part.
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
Client-side (JavaScript) Validation. Associating a function with a click event – Part 1 Use the input tag’s onclick attribute to associate a function.
© 2010 Robert K. Moniot1 Chapter 6 Introduction to JavaScript.
Build in Objects In JavaScript, almost "everything" is an object.
Week 3: Introduction to Javascript
HTML & teh internets.
HTML & teh internets.
DHTML.
Introduction to JavaScript for Python Programmers
What happens when this code executes?
PHP an introduction.
JavaScript.
Introduction to JavaScript
Web Programming and Design
Web Programming and Design
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
Presentation transcript:

1 HTML & teh internets

2 Contents JavaScript CSS Goal: Integrating knowledge

HTML, CSS, JavaScript 3 HTML –Layout: CSS –Scripting: JavaScript Plain text Dynamic HTML

Simple program <!-- var x = 1; var y = 2; var sum = x + y; document.write( sum ); //--> 4

Dynamic typing sum = 4 + x + y; –Variable sum becomes a number –On the screen: 7 sum = '1 + 2 = ' + x + y; –Variable sum becomes a string –On the screen: = 12 sum = '1 + 2 = ' +( x + y ); –On the screen: = 3 sum = x+' + '+y+' = '+(x+y); –On the screen: = 3 5

Dynamic typing Declare a variable var xyz; (can’t begin with number) Assign a value xyz = 12; //integer Type depends on declaration xyz = 'hello'; //string xyz = 1.5; //float xyz = true; //boolean In one go… var xyz = 'hello'; 6

Function <!-- function addNumbers( n,m ) { document.write( n + m ); } //--> 7

Functions and scope function addNumbers( n, m ){ var result = n + m; n = 1; m = 1; return result; } var result = 0; var m = 3; var n = 4; var sum = addNumbers( n, m ); //what is the value of the variables? 8

Calling a function Mind the new HTML tag! Inputs are used in forms 9

Inputs X can be –Text –Button –Radio –Checkbox –Hidden Y should generally be unique in a page Z can be a preset value 10

Constructs var i = 0; for ( i=1; i<=10; i++ ){ document.write("x = "+i+" " ); } var d = new Date(); //new date object var time = d.gethours(); //call method from object if (time<9){ document.write("Good morning!"); } else{ document.write("You're late!"); } 11

Objects and methods We’ll only use stuff that’s coming with JavaScript –Date object –Math object –String as an object Objects have methods and properties –Property is a predefine value –Method is a function within an object

Fibonacci example Time for an exercise –Fibonacci sequence –0, 1, 1, 2, 3, 5, 8, 13, 21, etc For non-Mathheads –0 + 1 = 1 –1 + 1 = 2 –1 + 2 = 3 –2 + 3 = 5 Condition –I want you to use a function and an input

What did we learn? Function 008 document.getElementById('n').value 017 result = result +c + " "; 023 document.getElementById('result'). innerHTML = result; Input 031 <input type='button' value='Iterate‘ onclick='makeSequence()'> Place for result

So… we learned JavaScript? JavaScript is interesting for two things –Creating simple applications –For designing navigation I have no issues at all with the first –You want to use a tool? Get the goods! I do have issues with the second –You enter and the navigation is missing? –You click a link and nothing happens? –Sloppy JavaScript + JavaScript disabled

Examples Failing apps – – Failing navigation – – phphttp:// php Gracious degradation –

Question… Why do you actually want a fold-up menu? Mind that about 5% of the populace has JavaScript turned off So what could you use JavaScript for in the proper way? –See article on EMM website

Today… I’ll entertain you with a real programmer’s problem. –Idea –Problems –Google Ask about your (technical) issues –Next week as well

19 Done