CS 174: Web Programming April 21 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak www.cs.sjsu.edu/~mak.

Slides:



Advertisements
Similar presentations
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
Advertisements

Session 4 Chapter 15 - How to Use jQuery Mobile to Build and Mobile Web Site ITI 134: HTML5 Desktop and Mobile Level II
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Unit 20 - Client Side Customisation of Web Pages
Tutorial 4: Creating page layout with css
CNIT 132 Intermediate HTML and CSS jQuery Mobile.
CONCEPTS FOR FLUID LAYOUT Web Page Layout. Website Layouts Most websites have organized their content in multiple columns (formatted like a magazine or.
Chapter 6 Basic forms 1. Forms and query string 2 form : a group of user input (UI) controls that accepts information from the user and sends the information.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Lecture Cascading Style Sheets (CSS) Internal Style Sheets Classes.
Cascading Style Sheet (CSS) Instructor: Dr. Fang (Daisy) Tang
4.01 Cascading Style Sheets
Chapter 8 More on Links, Layout, and Mobile Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
CS 174: Web Programming February 26 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Web Page Creation Part II ST: Introduction to Web Interface Design Prof. Angela Guercio.
RESPONSIVE DESIGN Sources: Kadlec, T. (2012). Implementing responsive design. Berkeley, California: New Riders Publishing. MarcotteMarcotte, E. (2010).
Using Cascading Style Sheets (CSS) Dept. of Computer Science and Computer Information CSCI N-100.
CS 174: Web Programming April 16 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
TUTORIAL 8: Enhancing a Web Site with Advanced CSS
CIT 256 Mobile Web Development Dr. Beryl Hoffman.
CS 174: Web Programming April 9 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
Chapter 8 More on Links, Layout, and Mobile Copyright © 2013 Terry Ann Morris, Ed.D revised by Bill Pegram, 9/24/
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Mike Hamilton V.P. Product Evangelism MadCap Software Content Authoring for Responsive Design.
CONCEPTS FOR FLUID LAYOUT Web Page Layout. Website Layouts Most websites have organized their content in multiple columns (formatted like a magazine or.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
18 People Surveyed HTML (HyperText Markup Language) HTML “tags” Describes structure Building blocks Headings, paragraphs, lists, links, images, quotes,
Week 8 – Part 3 More on Links, Layout, and Mobile Key Concepts 1.
IDs versus Classes Naming Your Tags for Maximum Functionality.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CSS My favourite ICT lesson By Federico Boschi Cascading Style Sheets.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
CO1552 – Web Application Development Cascading Style Sheets.
PRESENTED BY Content Authoring for Responsive Design Mike Hamilton V.P. Product Evangelism at MadCap Software
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
CS 174: Web Programming September 30 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
Tutorial #6 – Creating Fixed Width Layouts. Tutorial #5 Review – Box Model Every html element is surround by a box Content, Padding, Border, Margin Can.
JQuery Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
Week 8 – Part 2 Page Layout Basics Key Concepts 1.
CS 174: Web Programming September 28 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 174: Web Programming September 9 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
Introduction to CSS. Why CSS? CSS Provides Efficiency in Design and Updates CSS relatively easy to use Can give you more flexibility and control Faster.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Designing Web Pages The case for CSS. The Power of CSS css Zen Garden
CS 174: Web Programming October 28 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
JavaScript and Ajax (JavaScript Dynamic HTML (DHTML)) Week 7 Web site:
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
>> CSS Layouts. Recall Properties of Box – Border (style, width, color) – Padding – Margin – Display – Background – Dimension Welcome Padding Area Border.
CONCEPTS FOR FLUID LAYOUT Web Page Layout. Essential Questions What challenges do mobile devices present to Web designers? What are the basic concepts.
CSS (Cascading Style Sheets). CSS CSS – Cascading Style Sheets – Cascade because of the way CSS rules can stack on top of each other. Allows you to add.
National College of Science & Information Technology.
Web Development & Design Foundations with HTML5
The Box Model in CSS Web Design – Sec 4-8
CSS Layouts: Grouping Elements
Web Development & Design Foundations with HTML5
Web Development & Design Foundations with HTML5 7th Edition
CS134 Web Design & Development
Responsive Web Design (RWD)
Chapter 7 Absolute/relative hyperlinks Frag id 3-column site
Web Page Layout Imran Rashid CTO at ManiWeber Technologies.
Web Design & Development
Web Development & Design Foundations with HTML5
Various mobile devices
Presentation transcript:

CS 174: Web Programming April 21 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Web Services  A web service is “a software system designed to support interoperable machine-to-machine interaction over a network”.  The service is provided by a server machine (the web service provider).  Client applications make service requests to the server and get back responses.  A popular form of distributed computing. 2

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Traditional Web Services  Traditional web services were each described by a service contract written in the Web Services Description Language (WSDL). The WSDL document is an XML document.  The WSDL document and the request and response messages are transmitted over HTTP.  Messages use the Service Oriented Architecture Protocol (SOAP). SOAP is also an XML format. 3

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak RESTful Web Services  A simpler web services protocol is REST. Representational State Transfer  A software architecture style consisting of guidelines and best practices for creating scalable web services. 4

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Browser-Based Web Service Clients  You can invoke many web services today from a web browser using AJAX.  You download JavaScript code from the web service provider that makes the AJAX calls. Therefore, you don’t worry about what protocol the web service provider uses.  Popular web service providers include Google, Facebook, Amazon, etc. 5

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Example Web Service: Google Maps  Google provides a large number of web-based web services, such as Google Maps. See Download the JavaScript API 6

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Example Web Service: Google Maps, cont’d 7 Geolocation Map <link rel="stylesheet" type="text/css" href="css/map.css" /> <script type="text/javascript" src=" <script type="text/javascript" src="js/map.js"> Google Map with Geolocation map.html

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Example Web Service: Google Maps, cont’d 8 var map; function init() { var mapOptions = {"zoom": 6}; map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(positionMap, cannotPositionMap); } else { handleNoGeolocation(false); } map.js

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Example Web Service: Google Maps, cont’d 9 function positionMap(position) { var pos = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); var infowindow = new google.maps.InfoWindow( {"map": map, "position": pos, "content": "Location found using HTML5."}); map.setCenter(pos); } function cannotPositionMap() { handleNoGeolocation(true); } map.js

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Example Web Service: Google Maps, cont’d 10 function handleNoGeolocation(errorFlag) { if (errorFlag) { var content = "Error: The Geolocation service failed."; } else { var content = "Error: Your browser doesn't support geolocation."; } var options = {"map": map, "position": new google.maps.LatLng(60, 105), "content": content}; var infowindow = new google.maps.InfoWindow(options); map.setCenter(options.position); } google.maps.event.addDomListener(window, "load", init); Demo map.js

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Mobile Apps  Most mobile devices today have an HTML5-compliant browser.  Therefore, the easiest way to create a mobile app is to create a web app.  A web app for a mobile device has to accommodate the device’s screen size and use special input elements. Examples: Open special keyboards with prominent / : keys. 11

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Responsive Websites and Viewports  The default browser behavior on many mobile devices is simply to shrink the web pages to fit the smaller screen.  What you want instead is a responsive website. The layout, font sizes, etc. automatically adjust to accommodate the smaller screen size.  Change the default behavior with the viewport meta-element: 12 <meta name="viewport" content="width=device-width, initial-scale=1">

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Responsive Websites and Viewports, cont’d 13 No viewport.With viewport. HTML and CSS, 8 th ed. by Elizabeth Castro and Bruce Hyslop Peachpit Press, 2014 ISBN

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak CSS Media Types  A rule allows you to specify a media type such as print and screen to determine which CSS rules should apply. Example: Change the font size for printing.  You can also add a qualifying condition. Example: print { body { font-size: 10pt; (max-width: 500px) {... }

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Qualifier 15 Qualifier Demo <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="css/qualifier.css" /> qualifier.html

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Qualifier, cont’d 16 Qualifier Demo Try resizing this page. When the page is wider than 700 pixels, it shows black text on a white background. When the page is narrower than 700 pixels, the colors reverse, giving white text on a black background. qualifier.html

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Qualifier, cont’d 17 body { font-family: sans-serif; color: black; background-color: white; (max-width: 700px) { body { color: white; background-color: black; } } Demo qualifier.css

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Responsive Layout  Automatically make dramatic layout changes for a smaller screen.  True responsive design: Not just shrink elements. Make major layout changes. 18

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Responsive Layout, cont’d 19 Responsive Layout <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="css/layoutWide.css" /> <link rel="stylesheet" type="text/css" href="css/layoutNarrow.css" /> layout.html

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Responsive Layout, cont’d 20 Responsive Layout Demo one two three four five layout.html

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Responsive Layout, cont’d 21 Try this page on different sizes of screens. On wider browsers, it will have a two-column layout. On a smaller screen (like a phone,) it will revert to a single-column format better for mobile browsers. This is my footer. layout.html

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Responsive Layout, cont’d 22 body { font-family: sans-serif; background-color: lightgray; } #all { background-color: white; width: 600px; margin-left: auto; margin-right: auto; } header { text-align: center; } nav { background-color: green; float: left; width: 150px; color: white; height: 400px; } #content { background-color: yellow; float: left; width: 440px; height: 400px; padding-left: 10px; } footer { color: white; background-color: gray; clear: both; text-align: center; } layoutWide.css

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak Responsive Layout, cont’d (max-width: 600px) { #all { width: 90%; font-size: 125%; } nav { display: block; width: 100%; height: auto; } #content{ display: block; width: 95%; height: auto; padding-left: 5%; } footer { display: block; width: 100%; } Demo layoutNarrow.css

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak jQuery Mobile Library  Use the jQuery Mobile Library for mobile apps.  Mobile Theme Roller:

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak jQuery Mobile Accordion 25 Mobile Accordion <link rel="stylesheet" href=" /> <script type="text/javascript" src=" <script type="text/javascript" src=" Mobile Accordion Demo acordion.html

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak jQuery Mobile Accordion, cont’d 26 <div data-role = "collapsible-set" data-theme = "c" data-content-theme = "b"> CS 145 Fundamentals: Contiguous and non-contiguous memory management; processor scheduling and interrupts; concurrent, mutually exclusive, synchronized and deadlocked processes; files. Substantial programming project required. Prerequisite: CS 146 or SE 146 (with a grade of "C-" or better). acordion.html

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak jQuery Mobile Accordion, cont’d 27 CS CS CS Demo acordion.html

Computer Science Dept. Spring 2015: April 21 CS 174: Web Programming © R. Mak jQuery Mobile Multipage  Break a single web document into multiple pages to fit a smaller screen. 28 Demo