Real World Ajax Learning the magic behind Google, Yahoo!, and other Ajax-driven websites

Similar documents
Lesson 5 Introduction to Cascading Style Sheets

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

We aren t getting enough orders on our Web site, storms the CEO.

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar with Dynamic Background Image

Guidelines for doing the short exercises

Creating a Navigation Bar with a Rollover Effect

Chapter 8: Using Toolbars

Using AJAX to Easily Integrate Rich Media Elements

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar

Introduction to using HTML to design webpages

Website Development with HTML5, CSS and Bootstrap

Web 2.0, AJAX and RIAs

Developing Ajax Web Apps with GWT. Session I

Hands On: Dreamweaver CS3 NEW SPRY Widgets

GIMP WEB 2.0 MENUS. Web 2.0 Menus: Horizontal Navigation Bar. Hover Effect:

Dreamweaver CS5 Lab 4: Sprys

Using Dreamweaver CC. 6 Styles in Websites. Exercise 1 Linked Styles vs Embedded Styles

State of the Open Web. Brad Neuberg, Google

Designing the Home Page and Creating Additional Pages

AIM. 10 September

GIMP WEB 2.0 MENUS. Before we begin this tutorial let s visually compare a standard navigation bar and a web 2.0 navigation bar.

The Structure of the Web. Jim and Matthew

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

Introduction to WEB PROGRAMMING

Objective % Select and utilize tools to design and develop websites.

Using Dreamweaver CS6

Learn Dreamweaver CS5 in a Day

Chapter 7 BMIS335 Web Design & Development

This document provides a concise, introductory lesson in HTML formatting.

Introduction to CSS. 2 Sep 13. Derek Peacock. An introduction to defining CSS style rules using tags, classes and ids.

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

Dreamweaver Basics Outline

CSS Mapping in Advanced Mode for Events. Cvent, Inc 1765 Greensboro Station Place McLean, VA

Create a Web Page with Spry Navigation Bar. March 30, 2010

Styles, Style Sheets, the Box Model and Liquid Layout

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

Macromedia RoboHelp Course Outline

CSS for Page Layout Robert K. Moniot 1

AGENDA :: MULTIMEDIA TOOLS :: (1382) :: CLASS NOTES

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

Bonus Lesson: Working with Code

NAVIGATION INSTRUCTIONS

E ECMAScript, 21 elements collection, HTML, 30 31, 31. Index 161

CST272 Getting Started Page 1

CSE 154: Web Programming Autumn 2018

Which is why we ll now be learning how to write in CSS (or cascading sheet style)

HTML and CSS a further introduction

Niagara 3.7 New Feature Review

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

HTML & CSS. Rupayan Neogy

Using Dreamweaver. 6 Styles in Websites. 1. Linked or Imported Stylesheets. 2. Embedded Styles. 3. Inline Styles

Adobe Dreamweaver CC Tutorial

Tutorial 4. Activities. Code o Editor: Expression Web o Focus : Base Layout, navigation with folders, external stylesheets, Open up Expression Web

Web Designer s Reference

ADOBE 9A Adobe Dreamweaver CS4 ACE.

Adobe Dreamweaver CC Tutorial

Mouse-over Effects. Text based buttons

BIM222 Internet Programming

NOTE: For this tutorial you will need Internet Explorer Click Site, then New Site, go to the Templates tab. Fig. 1.0

Atom: From Blogging to Data, Web (Services) 2.0

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

COMP519 Web Programming Lecture 3: HTML (HTLM5 Elements: Part 1) Handouts

Designing for Web Using Markup Language and Style Sheets

Figure 1 Properties panel, HTML mode

HTML5: Adding Style. Styling Differences. HTML5: Adding Style Nancy Gill

Exploring Computer Science Web Final - Website

Help Documentation. Copyright 2007 WebAssist.com Corporation All rights reserved.

a.) All main headings should be italicized. h1 {font-style: italic;} Use an ordinary selector. HTML will need no alteration.

Data Visualization (DSC 530/CIS )

BA. (Hons) Graphics Design

Next... Next... Handling the past What s next - standards and browsers What s next - applications and technology

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

Programmazione Web a.a. 2017/2018 HTML5

Cascading Style Sheets for layout II CS7026

AJAX Workshop. Karen A. Coombs University of Houston Libraries Jason A. Clark Montana State University Libraries

10.1 Overview of Ajax

Adobe Dreamweaver CS4

Tutorial 4: Creating Special Effects with CSS

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

COMS 359: Interactive Media

LaGuardia Community College Thomson Ave, Long Island City, New York Created by ISMD s Dept. Training Team. Overview

HTML and CSS COURSE SYLLABUS

PRESENCE. RadEditor Guide. SchoolMessenger 100 Enterprise Way, Suite A-300 Scotts Valley, CA

Connecting the Dots. Building Web Applications with PHP, HTML, CSS, and JavaScript

Data Visualization (CIS/DSC 468)

ver Wfl Adobe lif Sams Teach Yourself Betsy Bruce Robyn Ness SAMS 800 East 96th Street, Indianapolis, Indiana, USA WlM John Ray ^lg^

Criterion D: Product design

Website Development (WEB) Lab Exercises

DEVELOPMENT OF WEB BASED GIS APPLICATIONS USING ARCGIS SERVER API 3.X FOR JAVASCRIPT ONLINE TRAINING GIS. Course. Training. .com

Creating a CSS driven menu system Part 1

CSS. Selectors & Measurments. Copyright DevelopIntelligence LLC

CREATING A WEBSITE USING CSS. Mrs. Procopio CTEC6 MYP1

Part of this connection identifies how the response can / should be provided to the client code via the use of a callback routine.

Outline. AJAX for Libraries. Jason A. Clark Head of Digital Access and Web Services Montana State University Libraries

HTML5 MOCK TEST HTML5 MOCK TEST I

Mark Scheme. June Pearson Level 2 Certificate in Digital Applications. Unit 5: Coding for the Web

Designing RIA Accessibility: A Yahoo UI (YUI) Menu Case Study

Web AppBuilder for ArcGIS Dive Into Mobile Development. Yiwei Ma & Kevin Gao

GRITS AJAX & GWT. Trey Roby. GRITS 5/14/09 Roby - 1

Photo from DOM

Transcription:

Real World Ajax Learning the magic behind Google, Yahoo!, and other Ajax-driven websites Scott Davis Davisworld Consulting Scott Davis Real World AJAX Page 1

Introduction My name is Scott Davis JBoss At Work (O Reilly) Google Maps API (Pragmatic Bookshelf) Pragmatic GIS (Pragmatic Bookshelf) Scott Davis Real World AJAX Page 2

The release of Google Maps (Feb 7, 2005) was a Wizard of Oz / Technicolor moment Not just for web mapping, but for web development in general It put Ajax on the map (no pun intended) Jesse James Garrett s seminal article coining the phrase (and mentioning GM) was published on Feb 18, 2005 What made it special was that it didn t require a proprietary plug-in It used standard technologies (JavaScript, CSS) in new and interesting ways Scott Davis Real World AJAX Page 3

Welcome to Web 2.0 Ajax Web Services In this talk, we ll look at next generation website features and show you how to incorporate them into your own website Scott Davis Real World AJAX Page 4

Examples Google Maps Slippy Maps Yahoo! Mail Tabbed interfaces Apple Live subtotals Scott Davis Real World AJAX Page 5

Ajaxian Techniques It all boils down to: CSS Divs Events Scott Davis Real World AJAX Page 6

CSS Cascading Style Sheets More than just pretty colors and fonts CSS Positioning is key to many ajaxian features Scott Davis Real World AJAX Page 7

No Style Scott Davis Real World AJAX Page 8

Style #1 Scott Davis Real World AJAX Page 9

Style #2 Scott Davis Real World AJAX Page 10

csszengarden.com For more examples of the power of CSS, see: Scott Davis Real World AJAX Page 11

Divs Divs are semantically-named divisions of HTML Scott Davis Real World AJAX Page 12

CSS can be used to style regular old HTML tags Scott Davis Real World AJAX Page 13

or it can be used to style Divs Scott Davis Real World AJAX Page 14

Events The key to an interactive web site is tapping into the JavaScript event model Courtesy: http://www.w3schools.com/jsref/jsref_events.asp Scott Davis Real World AJAX Page 15

Ajax Frameworks Working with CSS, Divs, and Events is considerably easier when helper frameworks come along for the ride: Prototype http://prototype.conio.net/ Script.aculo.us http://script.aculo.us/ Scott Davis Real World AJAX Page 16

Google Maps Slippy Maps -- how d they do that? Scott Davis Real World AJAX Page 17

Solution: Rolling Your Own Google Maps http://www.mapmap.org/ryogm ~200 lines of JavaScript 12 step-by-step pages take you from static HTML to a fully functional slippy map, including zooming and multiple map types Scott Davis Real World AJAX Page 18

RYOGM-1 Scott Davis Real World AJAX Page 19

RYOGM-1: Basic HTML Scott Davis Real World AJAX Page 20

RYOGM-2 Scott Davis Real World AJAX Page 21

RYOGM-2: Basic CSS Scott Davis Real World AJAX Page 22

RYOGM-5 Scott Davis Real World AJAX Page 23

RYOGM-5: Events Scott Davis Real World AJAX Page 24

RYOGM-5 Scott Davis Real World AJAX Page 25

CSS Whole map / viewable map <div id= viewablemap > #viewablemap { width: 500px ; } Scott Davis Real World AJAX Page 26

Divs Getting a <div> using $() Without Prototype: document.getelementbyid( foo ) With Prototype: $( foo ) Scott Davis Real World AJAX Page 27

Events Click, drag events Without Prototype: <div id= wholemap onmousedown= startdrag() > With Prototype: Event.observe( wholemap, mousedown, startdrag) Scott Davis Real World AJAX Page 28

Yahoo! Mail Tabbed interface how d they do that? Scott Davis Real World AJAX Page 29

Solution: DynamicDrive s Ajax Tabs http://www.dynamicdrive.com/ dynamicindex17/ajaxtabscontent/ Single zip file containing all required code, including a simple example Scott Davis Real World AJAX Page 30

Tabs, Unstyled Scott Davis Real World AJAX Page 31

Scott Davis Real World AJAX Page 32

Tabs, Styled Scott Davis Real World AJAX Page 33

This removes the bullet This makes the list horizontal instead of vertical Scott Davis Real World AJAX Page 34

CSS Links Rollover No JavaScript required to create the Rollover effect (These CSS styling rules are called pseudoclasses ) Scott Davis Real World AJAX Page 35

JavaScript Scott Davis Real World AJAX Page 36

Programmatically adding an onclick() to each <a> -- calls ajaxpage() Scott Davis Real World AJAX Page 37

JavaScript Ajax Scott Davis Real World AJAX Page 38

Scott Davis Real World AJAX Page 39

CSS UL, styled Links, hover style (no JavaScript needed) ID (singleton) vs. Class Selectors.shadetabs li a{ } Pseudoclasses.shadetabs li a:hover{ } Scott Davis Real World AJAX Page 40

Divs Placed Ajax content in the div <div id= ajaxcontentarea > Scott Davis Real World AJAX Page 41

Events OnClick > ajaxpage() Scott Davis Real World AJAX Page 42

The Apple Store Live Subtotals how d they do that? Scott Davis Real World AJAX Page 43

Solution: Let s view/source Scott Davis Real World AJAX Page 44

Dojo They re using the Dojo Ajax library Scott Davis Real World AJAX Page 45

They are building Divs on the fly Scott Davis Real World AJAX Page 46

Tabs Hyperlinks for tabs Scott Davis Real World AJAX Page 47

Subtotal Scott Davis Real World AJAX Page 48

The Order Form Scott Davis Real World AJAX Page 49

Summary Google Maps Slippy Maps Yahoo! Mail Tabbed interfaces Apple Live subtotals Scott Davis Real World AJAX Page 50

Ajaxian Techniques It all boils down to: CSS Divs Events Scott Davis Real World AJAX Page 51

Conclusion Questions? Thanks for your time! Email: scottdavis99@yahoo.com Code examples: http://www.davisworld.org/presentations Scott Davis Real World AJAX Page 52