BEFORE CLASS. If you haven t already installed the Firebug extension for Firefox, download it now from

Similar documents
LAST WEEK ON IO LAB. Install Firebug and Greasemonkey. Complete the online skills assessment. Join the mailing list.

Introduction to WEB PROGRAMMING

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

Frontend guide. Everything you need to know about HTML, CSS, JavaScript and DOM. Dejan V Čančarević

CSS worksheet. JMC 105 Drake University

Unveiling the Basics of CSS and how it relates to the DataFlex Web Framework

The Benefits of CSS. Less work: Change look of the whole site with one edit

UNIT -II. Language-History and Versions Introduction JavaScript in Perspective-

welcome to BOILERCAMP HOW TO WEB DEV

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

week8 Tommy MacWilliam week8 October 31, 2011

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

COMS 359: Interactive Media

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

Student, Perfect Final Exam May 25, 2006 ID: Exam No CS-081/Vickery Page 1 of 6

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

Lesson 5 Introduction to Cascading Style Sheets

HTML and CSS COURSE SYLLABUS

Brief Intro to Firebug Sukwon Oh CSC309, Summer 2015

Tizen Web UI Technologies (Tizen Ver. 2.3)

CSS Cascading Style Sheets

Block & Inline Elements

IN Development in Platform Ecosystems Lecture 2: HTML, CSS, JavaScript

COMSC-031 Web Site Development- Part 2

jquery Tutorial for Beginners: Nothing But the Goods

Deccansoft Software Services

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2017)

CSS Design and Layout Basic Exercise instructions. Today's exercises. Part 1: Arrange Page into Sections. Part 1, details (screenshot below)

ITS331 Information Technology I Laboratory

1. Cascading Style Sheet and JavaScript

Midterm Exam. 5. What is the character - (minus) used for in JavaScript? Give as many answers as you can.

Data Visualization (CIS/DSC 468)

Assignments (4) Assessment as per Schedule (2)

Basics of Web Technologies

HTML & CSS. Rupayan Neogy

HTML5. HTML5 Introduction. Form Input Types. Semantic Elements. Form Attributes. Form Elements. Month Number Range Search Tel Url Time Week

Web Designer s Reference

BIM222 Internet Programming

Software. Full Stack Web Development Intensive, Fall Lecture Topics. Class Sessions. Grading

Welcome to CS50 section! This is Week 10 :(

CS7026 CSS3. CSS3 Graphics Effects

PIC 40A. Midterm 1 Review

Guidelines for doing the short exercises

Exercise 1: Understand the CSS box model

Mobile Site Development

NEW WEBMASTER HTML & CSS FOR BEGINNERS COURSE SYNOPSIS

(Refer Slide Time: 01:40)

Designing the Home Page and Creating Additional Pages

Taking Fireworks Template and Applying it to Dreamweaver

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

Basic CSS Lecture 17

The Structure of the Web. Jim and Matthew

"a computer programming language commonly used to create interactive effects within web browsers." If actors and lines are the content/html......

SASS Variables and Mixins Written by Margaret Rodgers. Variables. Contents. From Web Team. 1 Variables

.hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in; } .tube {

FRONT END DEVELOPER CAREER BLUEPRINT

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

Data Visualization (CIS 468)

Web Designing Course

Introducing Cascading Style Sheets. Cascading Style Sheet Basics Creating Styles Using Styles Manipulating Styles Text Formatting with CSS

Cascading style sheets, HTML, DOM and Javascript

DATABASE SYSTEMS. Introduction to web programming. Database Systems Course, 2016

The default style for an unordered (bulleted) list is the bullet, or dot. You can change the style to either a square or a circle as follows:

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

CSS. Shan-Hung Wu CS, NTHU

Data Visualization on the Web with D3


WEB DEVELOPER BLUEPRINT

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018)

HTMLnotesS15.notebook. January 25, 2015

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

Why Use A JavaScript Library?

Perfect Student Midterm Exam March 20, 2007 Student ID: 9999 Exam: 7434 CS-081/Vickery Page 1 of 5

Page Layout Using Tables

PHP & My SQL Duration-4-6 Months

JavaScript Lecture 1

Styles, Style Sheets, the Box Model and Liquid Layout

IAT 355 : Lab 01. Web Basics

COMP519 Web Programming Lecture 6: Cascading Style Sheets: Part 2 Handouts

Website Design (Weekend) By Alabian Solutions Ltd , 2016

Programmazione Web a.a. 2017/2018 HTML5

N/A. JSN PageBuilder 2 Configuration Manual Introduction. System Requirements. Product Usage. Joomla Requirements. Server Requirement

Course Outline Advanced Web Design

Web Design & Dev. Combo. By Alabian Solutions Ltd , 2016

Webinar. The Lighthouse Studio Scripting Series. JavaScript Sawtooth Software, Inc.

Varargs Training & Software Development Centre Private Limited, Module: HTML5, CSS3 & JavaScript

JSN PageBuilder 2 User Manual

CSC309 Winter Lecture 2. Larry Zhang

Frontend II: Javascript and DOM Programming. Wednesday, January 7, 15

Data Visualization (DSC 530/CIS )

What do we mean by layouts?

Dreamweaver Domain 5: Organizing Content by Using Dreamweaver CS5

Table Basics. The structure of an table

INTRODUCTION TO JAVASCRIPT

CSS for Page Layout Robert K. Moniot 1

Final Exam Study Guide

Sections and Articles

Transcription:

BEFORE CLASS If you haven t already installed the Firebug extension for Firefox, download it now from http://getfirebug.com. If you don t already have the Firebug extension for Firefox, Safari, or Google Chrome, please install one of those now. We ll be using them for our in-class demos.

<script> SCRIPTING WITH JAVASCRIPT Nick Doty & Ryan Greenberg A warning: today is going to be a quick course in scripting web browsers (Javascript/JQuery). Another title for this lecture might be...

JAVASCRIPT CRASH COURSE Nick Doty & Ryan Greenberg A warning: today is going to be a quick course in scripting web browsers (Javascript/JQuery).

JAVASCRIPT CONSOLE If you don t already have the Firebug extension for Firefox, Safari, or Google Chrome, please install one of those now. We ll be using Firebug for our in-class demos today, but you can use any of these three browsers. If you are using IE, stop.

Web Browsers Bookmarklets Greasemonkey Photoshop PLACES TO USE JAVASCRIPT

FIRST THINGS FIRST JavaScript is a high-level, object-oriented language used most often in web browsers. You can write comments in your code with // or /* */ A semi-colon goes at the end of every statement. It s a dynamic, scripting language. What does it have to do with Java? Nothing. How many of you have written Javascript before? How many of you have used a programming language before?

VARIABLES 29 'Bob' true Numbers Strings Boolean ['Bob', 'John', 'Coye', 'Deirdre'] Arrays {'name': 'Arnold', 'weight': 240} Objects Variables can be of different types. We re going to cover these basic data types.

VARIABLES var statename = 'California'; You use the word var to declare a variable. You don t have to say what type of variable it is. The convention is to use camelcase.

STRINGS A sequence of characters. Use single- or double-quotes to indicate a string. Examples var myname = "Larry"; myname "Larry" myname.length 5 myname.touppercase() "LARRY" myname.indexof('a') 1

ARRAYS An ordered collection of elements. Use square brackets to indicate an array. Examples var myarray = ['dog', 'fish', 'cat']; myarray.length 3 myarray[0] ['dog'] myarray.push('horse') ['dog', 'fish', 'cat', 'horse'] myarray.sort() ['cat', 'dog', 'fish'];

OBJECTS A collection of key-value pairs or named properties. Use braces to indicate an object. Examples var person = {'name': 'Arnold', 'weight': 240, 'height': 6.2 } person.name "Arnold" person.height 6.2 person.wife = 'Maria'; person.wife 'Maria' person['wife'] 'Maria' The most confusing thing about objects in JavaScript is that they re used for so many different things. First, they fill the role of the data structure: hashes/dictionaries (in Python)/ associative arrays. Second, objects are naturally used for JavaScript s object-oriented programming. Third, JavaScript objects are also the basis for JSON. You can access the properties of an object using the dot notation or bracket notation.

FUNCTIONS function add(x, y) { return x + y; } add(2,4) 6

BROWSER FUNCTIONS alert(' ') confirm(' ') prompt(' ') console.log(' ') Type alert( Hello world ); into your console. var c = confirm( Are you sure you want to delete this? ); c will be true if the user clicks OK, false if the user clicks Cancel var p = prompt( What is your name? ); p contains the user s response, or null if the user clicked Cancel

CONTROL STRUCTURES if (3 > 2) { alert('3 is greater than 2'); } for (var i=0; i < myarray.length; i++) { myarray[i]; };

CASCADING STYLE SHEETS Separate presentation from structure and content. If you want to be impressed by what s possible with CSS, see http://csszengarden.com.

CASCADING STYLE SHEETS Separate presentation from content Provide us with a language to specify elements in the DOM

RULE STRUCTURE From CSS: The Definitive Guide A stylesheet consists of a series of rules. Here you see the structure of a style rule. You start with a selector, which specifies what elements in the DOM you want this rule to apply to. Then you write one or more declarations to apply styles to that selection. Declarations are separated by semi-colons.

SELECTORS CSS HTML Type (Tag) p <p> Id #header id="header" Class.author class="author" Descendent div p <div><p> Grouping h1, h2 <h1> and <h2> Who can explain the difference between IDs and classes? IDs are unique, only occur once on the page. Classes are recurring elements. Both can add semantic meaning to the page. For a complete list of selectors in CSS2, see http://www.w3.org/tr/css2/selector.html. For a list of all the selectors that jquery can use (which are a lot more than CSS2), see http:// docs.jquery.com/selectors.

COMMON PROPERTIES font-family color border display margin font-size width padding background position text-align float See http://htmldog.com/reference/cssproperties/ for a good list of CSS2 properties. Let s do some examples. (1) I want to make the blog title orange. (2) Align the text in the header: #header { text-align: center; } (3) Make every author s name s much bigger..author (4) I want to make the titles of the blog entries blue Papyrus.

Questions CSS RESOURCES Available free for students at http://proquest.safaribooksonline.com. Erik has a number of resources posted on the Mobile App site. You also have access to these. CSS definitive guide: http://proquest.safaribooksonline.com/0596527330 Heads-First XHTML & CSS: http://proquest.safaribooksonline.com/059610197x/hfhtmlcss- CHP-8?imagepage=285 Expanding your vocabulary http://proquest.safaribooksonline.com/059610197x/ hfhtmlcss-chp-8?imagepage=285

CSS meets JavaScript jquery is a JavaScript library (intro. 2006) written by John Resig. When learning: great when you can apply something you know to something else. A lot of JS in browser has to do with selecting objects from the DOM. And we already have something to do that...css!

JQUERY $ = jquery

JQUERY Using jquery involves two steps: Selects objects from the DOM using CSS selectors. Do something with the selected elements.

JQUERY Using jquery involves two steps: $( p ).hide() Here we see what this looks like using jquery s dollar sign syntax. In the first part of this statement, we select an object. Question: what does p select? (all the paragraphs on the page). In the second part we do something with it. Question: what would you guess hide() does?

DOCUMENT OBJECT MODEL body div id=header div id=content h1 p p p ul li li li As Erik discussed on Monday, when your web browser loads this document, it generates a representation called the Document Object Model. This is a collection of objects that you can manipulate and change. See http://en.wikipedia.org/wiki/document_object_model for more information.

DOCUMENT OBJECT MODEL body div id=header div id=content $( h1 ) $( #content ) h1 p p p $( li ) ul li li li What portions of the DOM on the left do these examples select?

JQUERY DEMONSTRATION http://j.mp/mobileappdom Script and examples found in iolab/learning_javascript/lecture2_firebug_examples in the section jquery DOM Examples. Change the title of my blog to "Mobile Web Apps". (Use inspector to see what that DOM element is). $( h1 ).text( Mobile Web Apps ) Fade out all the h2s with class author. Fade them back in.

MAIN JQUERY OPERATIONS Attributes: Changing existing elements. Traversing: Moving from selected elements in the DOM to others. Manipulating: Inserting or removing elements. Events: Attaching functions to events in the browser.

QUESTIONS?