Movatterモバイル変換


[0]ホーム

URL:


Todd Anglin, profile picture
Uploaded byTodd Anglin
PPTX, PDF15,763 views

HTML5 Bootcamp: Essential HTML, CSS, & JavaScript

The document details a workshop agenda led by Todd Anglin on essential HTML, JavaScript, and CSS, highlighting topics relevant to modern web development using HTML5 and its features. It emphasizes the importance of progressive enhancement, browser compatibility, and practical coding strategies to enhance user experience across different platforms. Additionally, it discusses various HTML5 capabilities like geolocation, local storage, and multimedia support, along with coding best practices for developing contemporary web applications.

Embed presentation

Downloaded 356 times
HTML5 BootcampEssential HTML, JavaScript & CSSTodd AnglinEVP Product Strategy, Telerik
Workshop Downloads:http://bit.ly/TaskListDemo(https://github.com/toddanglin/TaskListDemo.git)http://bit.ly/workshoplabs(Case sensitive)
10 %Read20%Hear30% See50% Hear + See70% Say + Write90% ExperienceYou generally remember...
EVP Product Strategy, Telerik5x Microsoft MVP, ASP Insider, O'Reilly Authoranglin@telerik.comTexMex5’ 9”41 (Birkenstock)
Workshop AgendaTime Topic8:30 AM to Noon HTML5Noon to 1:00 PM LUNCH1:00 PM to 4:30 PM JavaScript & CSS3WHY + HOW
Morning AgendaTime Topic8:30 AM Intro to HTML5 & Fundamentals11:00 AM HANDS ON11:25 AM Modern HTML App Patterns OverviewNoon Lunch
HTML5 SitesHTML5 AppsHTML5 Enriched
21:02
the "plan"the options HTML5 the browsersuse it todayA&Q
Perhaps Adobeshould focus more oncreating great HTML5tools for the future, andless on criticizing Applefor leaving the pastbehind.” -Steve JobsApril, 2010“
21:02
21:02
Why is HTML5 #winningthe web?21:02
It's Important.
82%
It's Unifying.
It's Everywhere.
“While it continues to serve as arough guide to many of the corefeatures of HTML, it does notprovide enough information tobuild implementations thatinteroperate with each other and,more importantly, with a criticalmass of deployed content.”-W3C on HTML421:02
HTML4 = Rough GuideUnpredictable Browser Support
How is the webevolving?
<HTML>CSS:3;ECMAScript();“HTML5”
“Living Standard”WebSockets FileAPIWebGLHTML5 FormsGeolocationOfflineCanvas VideoAudioCanvasVideoGeolocationSemanticTagsSVGWHATWG | W3C | IETF21:02
Which browsersmatter?
Know your users.Know your browsers.
of internet browses withIE, FF, Safari, Chrome, or Opera99%
Source: comScore, Alexa, Flurry Analytic020406080100Jun-10 Dec-10 Jun-11 Dec-11PC & Mobile Web BrowsingMobile Apps64MINUTES43MINUTES70MINUTES66MINUTES74MINUTES81MINUTES 72MINUTES94MINUTES
Canvas | Local Storage | Microdata |Document Editing | GeolocationSemantic Tags | Video/Audio |SelectorsWebGL | WebSockets | File API | Drag-Drop API |IndexedDB | Offline API | Web Workers | HTML5Forms21:02
21:02
IE9 offers support forthe most relevant,real-world web patternsthat developers areusing today aswell as the HTML5patterns weexpect to becomemore mainstream.”“Dean HachamovitchCorporate VP, IE
html5labs.interoperabilitybridges.comie.microsoft.com/testdrive+
25 26 41138 138286 287 303 320 329 337374 378 386 389 390 397 415 430 434 4484985050100200300400500600InternetExplorer6»InternetExplorer7»InternetExplorer8»InternetExplorer9»WinPhone7.5»Android4.0»Android4.3»Safari5.1»WinPhone8»Opera11.60»Firefox8»Chrome17»Safari6.0»iOS6.0»Opera12»ChromeMobile»Safari7.0»iOS7.0»Firefox24»Chrome22»Firefox28»Chrome32»Chrome33»relative HTML5 scoresIE10IE11
In the future,browsers competeon speed,not on features
DEMO
What is usable today?
X X X X XX X XX XX X XX XAdoption StrategiesOnly use featuresnatively available in alltarget browsers21:02
X X X X XX X XX XX X XX XAdoption StrategiesOnly use featureseither natively availableOR available viaJavaScript polyfillX X21:02
21:02
X X X X XX X XX XX X XX XAdoption StrategiesOnly use featuresavailable in targetbrowsers AND designalternate experiencefor other browsersX XX X XX X21:02
progressiveenhancementgracefuldegradation
[Source: Aaron Olaf, Flickr]21:02
[Source: Mercedes USA, http://mbusa.com/]21:02
X X X X XX X XX XX X XX XAdoption StrategiesCreate experiencestargeted at specificbrowsers (or classes ofbrowsers)X XX X XX X21:02
21:02
Don't sniff browsers.(Test for features.)
modernizr
Modernizr.[featureName]if (Modernizr.canvas) { //Use It! }.[featureName] || .no-[featureName].no-canvas { //Styles }.canvas { //Other Styles}
DEMOModernizr
<meta http-equiv="X-UA-Compatible" content="chrome=1">
25 26 41138303 320 329 337 374 378 389434050100150200250300350400450500relative HTML5 scores
<HTML5>
The Basics• <!DOCTYPE html>• 9 new “structure” tags• 16 new HTML elements• 13 new <input> types21:02
compatible
stuff you can dotodaystuff you can dotomorrow(or today, too, if IE support is not critical)
We'll cover a lot!But not nearly everything.
semantic tagsaudio & videoHTML5 Formsgeolocationweb storagedrag & dropcanvasofflineweb sqlindexedDBweb socketshistory apifile api
WebGLweb workersXHR2querySelectorclassListCORScryptoperformancevisibility apionline/offlinecustom protocoltyped arraysWeb Audio APIinline SVGFS APICanvasanimationnotificationsorientationmicrodataflexboxmore...For homework.
http://bit.ly/vsHTML5http://bit.ly/vsSVGAdd IntelliSense & Schema Validationto Visual Studio 2008/2010 (pre SP1)21:02
21:02HTML5 FormsGeolocationVideoCSS3{Web Sockets}{Storage}{IndexedDb}{Semantic Data}
21:02
semantic tagstag: <header> <footer> <nav> <article> <hgroup>support: IE9, FF3.5, Safari, Chrome, Opera<body><div id=‚header‛></div><div id=‚content‛><div id=‚nav‛></div></div><div id=‚footer‛></div></body><body><header></header><section><nav></nav></section><footer></footer></body>VS.
fixing IE<head><meta charset="utf-8" /><title>My Weblog</title><!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--></head>*Polyfill required to trigger styling in old IE21:02
Why use it?• Accessibility*• SEO*• Code readability• Developer street cred• Why not?21:02
semantic datadata-*Valid approach to storing data in HTML<!--Store values in data-* attributes--><div id="mydiv" data-key="26" data-name="My product name">...</div><!--Access values with JavaScript-->var key = mydiv.getAttribute("data-key")//ORvar key = mydiv.dataset.keysupport: IE9, FF3.5, Safari, Chrome, Opera
Why use it?• Embed data in page21:02
video & audioSemantic rich mediaReach more people on more devicesContainerCodecSilverlightFlashHTML5
video for all browsers*<video src="clip.mp4" controls type="video/mp4"><object classid="..."><param name="flashvars" value="file=clip.mp4" /><param name="movie" value=“player.swf" /><embed src="player.swf” type="application/x-shockwave-flash” flashvars="file=clip.mp4" />Your browser does not support video</object></video>support: IE9, FF3.6, Safari, Chrome, Opera21:02
Why use it?• Video for plug-less mobiledevices• Eliminate dependencieson Flash/Silverlight (futureproofing)21:02
canvastag: <canvas /><canvas id=‚b" width="300" height="225"></canvas>function draw_b() {var b_canvas = document.getElementById("b");var b_context = b_canvas.getContext("2d");b_context.fillRect(50, 25, 150, 100);}support: IE*, FF3, Safari, Chrome, Opera
fixing IE<head><!--[if IE]><script src="excanvas.js"></script><![endif]--></head>Explorercanvas21:02
Scalable VectorGraphicsCanvasBitmap-outputGood foranimationJavaScript-basedVector-outputGood forinteractionXML-based21:02
Why use it?• Dashboards• Charts/Gauges• Resolutionindependence21:02• Games• Super customrenderingSVG Canvas
html5 forms*tag: time, date, search, email, etc.Web Forms 2.0 HTML5 Forms<form><input type="email" autofocus="autofocus"placeholder="Enter your email" /></form>support: Safari, FF4*, Chrome, Opera
validation• HTML: Required, Type, Pattern• JS: checkValidity()• CSS: :invalid, :valid, :required<form><input type="email" placeholder="Enter your email" requiredtitle="Please enter a valid email address" /><input type="submit" value="Go" /></form>
via A List Apart (bit.ly/html5validation)21:02
21:02iOS 7 deprecated datetime support& handles week poorly
progressive enhancement<form name="f"><input id="q" autofocus><!--Technique to support older browsers--><script>if (!("autofocus" in document.createElement("input"))) {document.getElementById("q").focus();}</script><input type="submit" value="Go"></form>
21:02“Consuming raw or undercookedmeat, poultry, seafood, shellfish or eggs mayincrease risk of foodborne illness.”
21:02
COOKEDRAWhtml5 forms21:02Available heat:- Kendo UI (validation + UI)- jQuery HTML5 Form- H5F
Why use it?• Mobile input• Improved form behavior inmodern browsers• Semantic forms• New styling options21:02
geolocationnavigator.geolocation.getCurrentPosition(callback);function callback(position){var lat = position.coords.latitude;var lng = position.coords.longitude;var acc = position.coords.accuracy;}support: IE9, Safari, FF3.5, Chrome, Operaopt-in user feature to share physical position
COOKEDRAWgeolocation21:02
Why use it?• Enrich apps with locationawareness• Track user position21:02
local storagesessionStorage = per windowlocalStorage = per browser<script>sessionStorage.setItem('value', this.value);localStorage.setItem('value', this.value);sessionStorage.getItem(‘value’);sessionStorage.clear();localStorage.clear();</script>support: IE9, FF3.5, Safari, Chrome, Opera5 MB limit
http://htmlui.com:80protocolhost port(+ browser mode)
COOKEDRAWlocal storage21:02Available heat:- localstorage polyfill- amplifyJS- lawchairJS
Why use it?• Better than cookies• Simple API21:02
drag & drop APIeasy drag & drop for any HTML element<!-- Make an HTML element draggable --><div id=‚myDiv‛ draggable=“true”>...</div>//Handle the DnD events, such as Dropfunction onDrop(e){//e.target is the current target elementif(e.stopPropigation) e.stopPropigation(); //Prevent redirect//Do something with payloadreturn false;}support: IE9, FF, Safari, Chrome, Opera
IMGFileHTMLdraggabledragstartdragdragenterdragleavedragoverdropdragendChange appearance,Set payloadChange drop targetappearanceProcess DnDpayload
dragstartdrope.dataTransfer.setData([MIME type], [payload])e.dataTransfer.getData([MIME type])e.dataTransfer.files; //FileList object
COOKEDRAWdrag & drop21:02Available heat:- Kendo UI (DnD & Upload)- jQuery UI Draggable
Why use it?• Support DnD files in thebrowser• Reduce JS footprint21:02
stuff you can dotodaystuff you can dotomorrow
offlinetag: <html manifest="html5demo.manifest">MIME type: text/cache-manifestCACHE MANIFEST# Files you want cached for your app to work offlinemyLogo.jpg//Interacting with cachewindow.applicationCache.update();alert(window.applicationCache.status);support: FF3.5, Safari, Chrome, Opera 10.6
COOKEDRAWoffline21:02
Why use it?• Aggressive resourcecaching• Foundation for offline21:02
web sqlapi: openDatabasedb = openDatabase("html5demos", "1.0", "HTML 5 Database APIexample", 200000);if (db) {db.transaction(function(tx) {tx.executeSql("CREATE TABLE IF NOT EXISTS tweets (id REAL UNIQUE,text TEXT, created_at TEXT, screen_name TEXT,mention BOOLEAN)", [], callback);});}db.transaction(function (tx) {tx.executeSql('SELECT * FROM tweets WHERE mention = ? AND id > ? ORDERBY id DESC', [mention, latest], callbackFunc);});support: Safari, Chrome, Opera“This specification has reached an impasse: allinterested implementors have used the sameSQL backend (Sqlite), but we need multipleindependent implementations to proceed alonga standardisation path.”–W3C
indexedDBJavaScript API for indexed local storagevar request = window.indexedDB.open("CandyDB","My candy store database");request.onsuccess = function(event) {var db = event.result;if (db.version != "1") {// User's first visit, initialize database....}}support: IE9*, FF4, (Chrome)
COOKEDRAWindexedDB21:02Available heat:- IDBWrapper- PouchDB- lawnchairJS
Why use it?• Browser storage of largerdatasets• Offline data• Better than local storagefor complex dataoperations21:02
web socketsapi: WebSocketws = new WebSocket("ws://localhost:8282/test‛);ws.onopen = WSonOpen;ws.onmessage = WSonMessage;ws.onclose = WSonClose;ws.onerror = WSonError;function WSonMessage(event) {$(‚#myDiv‛).html(event.data);};support: IE9**, Safari 5, Chrome, FF4*, Opera 11*
Socket.IOSignalRSockJS
COOKEDRAWweb sockets21:02Available heat:- SignalR- Socket.IO- Sockjs
Why use it?• 2-way real-timemessaging• Replace long-polling &interval “hacks”• Eliminate dependencieson plug-ins21:02
file apiaccess to local file system & data streamingvar file = e.dataTransfer.files[0],reader = new FileReader();reader.onload = function (event) {var dataUrl = event.target.result;};reader.readAsDataURL(file);.readAsBinaryString(file);.readAsText(file);.readAsArrayBuffer(file);support: IE10, FF4, Chrome, Opera 11.1
COOKEDRAWfile api21:02
Why use it?• Process files with fewerserver trips• Improve usability• Desktop-like experiences• Better file upload21:02
history apidirect access to browser historyvar stateObj = { foo: "bar" };history.pushState(stateObj, "page 2", "bar.html");support: FF4, Safari 5, Chrome, Opera 11.5
</html>
LUNCH <BR />1-Hour Pit Stop. Resume @ 1:00 PM.
Afternoon AgendaTime Topic1:00 PM Tips for Better JavaScript2:45 PM Intro to CSS3 & Fundamentals4:00 PM Final Workshop Q&A4:30 PM Fin
HTMLAppPatterns
You are not a webdeveloper.
You are a webstandards developer.
<HTML>CSS:3;ECMAScript();
DEMO
In browserOut-of-browser{ }Always connectedSometimes connected{ }Site experienceApp experience{ }PackagedServed{ }
21:021. Website2. Single Page App (SPA)3. Mix
WebsiteHTMLConcepts: Pages, Server-side Views, Links, Thin Client
Website:Always connectedIn-browserServedSite experience21:02
Single Page Application (SPA)21:02JS
Single Page Application (SPA)JS21:02Concepts: Web Services, Client-side, Application
SPAs provide a morefluid user experience,similar to a "desktop"application.21:02
SPA:App Experience21:02
Native Shell +SDK ProxyNativeAppHTML/JS/CSSApp
Hybrid Approaches21:02JSDataJSDataSlicesofSPA
Hybrid Approaches21:02JSSPAShellSPAWebsite
Just because you'reusing web standards,doesn't mean you'rebuilding websites.21:02
21:02
<TODO: HAPPY PLACE IMAGE>
WhyJavaScript?WHY?!
It‟s the first?
It‟s the best?
It‟s the easiest?
It‟s the fastest?
It‟s everywhere.
No, really.Brendan Eich.Netscape.
“JS had to 'look like Java'only less so, be Java‟sdumb kid brother or boy-hostage sidekick. Plus, Ihad to be done in tendays or something worsethan JS would havehappened”
::::
Sept 1995NetscapeAug 1996MicrosoftJune 1997ECMAScript//Mar 1999XHRFeb 2005AjaxAug 2001IE6FirefoxSafariChromeMobile
JavaScript won bydefault.If you're the last man left onearth, it doesn't matter how uglyyou are when the women come tore-populate the planet.Scott Koon
Can‟t Beat „em,Join „em.
Modern JavaScriptFaster. Easier. Better.
Attwood‟s Law:Any application that can bewritten in JavaScript, willeventually be written inJavaScript2007
MOST COMMON PROBLEMS
1. Slow Execution2. Memory leaks3. Poor Code Organization4. Lack of Understanding
5(ISH) TIPS
From realmasters:JordanIvanTsvetomirAtanasBurkeJohnBrandon
TIP #1jQuery is a friend……that will stab you in the back.Prove It
CACHE OBJECTS$("#myDiv").css("color","red");$("#myDiv").css("opacity",1);BAD$("#myDiv").css("color","red").css("opacity",1);BETTERvar $myDiv = $("#myDiv");$myDiv.css("color","red");$myDiv.css("opacity",1);BEST*Prove It
NATIVE LOOPS$.each(arr, function (i) {i / 2;});BADarr.forEach(function (i) {i / 2;});BETTERvar i = 0, len = arr.length;for (i = 0; i < len; i += 1) {i / 2;}BEST*Prove It
TIP #2Avoid Global VariablesThey're slow & rude.
function add(num1, num2){return num1 + num2;}var result = add(5, 10);21:02Prove It
var name = "Todd";function sayHello(){alert(name);}function sayHello(){var name = "Todd";alert(name);}21:02BADBETTER
Closures & Module Pattern
function doInitStuff(){...}function loadSomething(){...}function handleButtonClick(){...}function harlemShake(){...}yourFile.js
function doInitStuff(){var user = "Todd";}function loadSomething(){if (user == "Todd") ...}function handleButtonClick(){...}function harlemShake(){...}yourFile.js
var user = "";function doInitStuff(){user = "Todd";}function loadSomething(){if (user == "Todd") ...}function handleButtonClick(){...}function harlemShake(){...}yourFile.js
var [window].user = "";function [window].doInitStuff(){user = "Todd";}function [window].loadSomething(){if (user == "Todd") ...}function[window].handleButtonClick(){...}function [window].harlemShake(){...yourFile.js
var app = (function(){var _name = "Todd";return{sayHello: function(){alert(_name);}}}());app.sayHello();21:02BEST(ISH)
var app = (function(){var _name = "Todd";return{sayHello: function(){alert(_name);},sayGoodbye: function(){alert(_name);}}}());21:02BEST(ISH)Your“Public” API
SUPER PATTERN(function(window,$,c){var _private = "Todd";function privateClass(){}function myWidget(){}myWidget.doSomething = function(){};window.myWidget = myWidget;}(window,jQuery,console));Immediately Invoked Function Expressions (IIFE) +Global Imports + [Prototype]Prove It
TIP #3Bind to Events & Pub/SubJust listen.
<button id="btn" onclick="sayHello();">Click Me</button>$(function(){$(‚#btn").on("click",sayHello);});21:02BADBETTER
$(document).on("click","button", sayHello);21:02BESTWhy?Compare A Compare B
function doSomthing{...doSomethingElse();doOneMoreThing();}21:02BAD
function doSomething() {...$(document).trigger("DO_SOMETHING_DONE");}$(document).on("DO_SOMETHING_DONE",function(){doSomethingElse();});21:02BETTERExample
function doSomething(successCallback, failCb){//Do something async...if(error){failCb();} else {successCallback();}}function doSomethingElse(){doSomething(function(){...}, function()...);}21:02ANOTHER PROBLEM
function doSomething(){var dfd = new $.Deferred();//Do something async, then...//dfd.resolve();//OR//dfd.reject();return dfd.promise(); //Returns immediately!}function doSomethingElse(){doSomething().done(//Success!).fail(//Error);}21:02ANOTHER SOLUTION
TIP #4Don't fondle the DOM.Go with the flow.
My Awesome PageCopyright Fo'evaLorem ipsumy samplishjibber jabbish text onlymeant to serve as aplaceholder, and much likePi, should never repeat orbe read much beyond thefirst few characters.
function doSomething{...var $list = $("body").append("<ul>");for(var i = 0; i < 10; i++){$list.append("<li>"+ i +"</li>")}}21:02BAD
function doSomething{...var $domChunk = $("<ul>");for(var i = 0; i < 10; i += 1){$domChunk.append("<li>"+ i +"</li>");}$("body").append($domChunk);}21:02BETTER
DOM SPEED WITHSTRINGS & INNERHTMLfunction doSomething{...var domString = "<ul>";for(var i = 0; i < 10; i += 1){domString += "<li>"+ i +"</li>";}domString += "</ul>"$("body")[0].innerHTML = domString;}Prove It
<script type="text/x-kendo-template" id="tmp"><ul>#for(var i = 0; i < data.length; i += 1){#<li>#= data[i] #</li>#}#</ul></script>function doSomething(){var myData = [1,..,10];var template = kendo.template($("#tmp").html());$("body").append(template(myData));}21:02BESTProve It
TIP #5Learn a module pattern.(Or some kind of app structure)
PERFORMANCE CONVENIENCE
A.jsB.jsManual (index.html)<script src="B.js"></script><script src="A.js"></script><script src="main.js"></script>Module Loader (main.js)require(["A","B"], function(){//Dependencies are loaded});
USE JSLINTGuaranteed to Hurt Your Feelings™21:02MINIFY YOUR JSWords are for humans.MASTER BROWSERDEV TOOLSDebug JavaScript where it runs.
Debugging
console.log()
Fix IE<script type="text/javascript"><!--Console global variable fix for IE-->if (!this.console) {window.console = {log: function() {}};}</script>21:02
Resources for Study• Books– #
console.clear();
21:02
21:02
[before CSS]<html><head>…</head><body><table><tr><td><font size=‚3‛ color=‚red‛><h1>Hello World!</h1></font></td></tr><font color=‚green‛><font face=‚Tahoma‛><h2>I’m green! I think.</h2></font><p>Lorem ipsum</p></font></table></body></html>{HTML}
Separation of Concerns*<html><head>…</head><body><header>…</header><article><h1>Hello!</h1><p>Lorem ipsum</p></article><nav>…</nav><footer>…</footer></body></html>structurebody { color:#FFF; }header { margin:5px; }article {margin:5px 0;padding: 10px;background: #333;}style{HTML} {CSS}
21:02
CSS has been plaguedwith inconsistencies &browser bugs
What's CSS3?CSS 2.0++++Module StatusAnimations WD2D/3D Transformations WDSelectors (Level 3) RECMedia Queries (Level 3) RECBackgrounds & Borders (rounded corners) CRText Decoration (text shadows, outline) CRCSS 2.1 RECWD LC CR PR REC21:02
WD LC CR PR RECCSS 2.1CSS3 ColorSelectorsMedia QueriesBackgrounds &BordersMulti-columnFlex BoxMarquee25+ DraftsTransitionsTransformationsAnimationsGradientsCSS3 Text21:02
Browser Prefixes-webkit-moz-o-ms"standard" waybrowsersimplement customfeatures.21:02
Prefixes are goingaway (eventually)21:02RECENT NEWSBrowser "flags" will handle emerging feature
-moz-border-radius: 5px 5px 5px 5px;-webkit-border-radius: 5px;border-radius: 5px;-moz-box-shadow: 2px 2px 2px #333;-webkit-box-shadow: 2px 2px 2px #333;box-shadow: 2px 2px 2px #333;-webkit-background-size: 137px 50px;-o-background-size: 137px 50px;background-size: 137px 50px;21:02
SelectorsColorCustom FontsBorders & BackgroundsGradientsMedia QueriesAnimationsTransitionsLayouts (Grid, Flex, etc)
1. Selectors2. Custom Fonts3. Whiz Bang StyleyWhimey4. Layouts
*E[foo]E[foo="bar"]E[foo~="bar"]E[foo|="en"]E:first-childE:lang(fr)E:hoverE:focusE:disabledE::beforeE::afterE > FE + FEE:linkE:activeE:visitedE::first-lineE::first-letterE.warningE#myidE FE[foo^="bar"]E[foo$="bar"]E[foo*="bar"]E:rootE:nth-child(n)E:nth-last-child(n)E:nth-of-type(n)E:nth-last-of-type(n)E:last-childE:first-of-typeE:last-of-typeE:only-childE:only-of-typeE:emptyE:targetE:enabledE:checkedE:not(s)E ~ F
CSS3 Selectors• Powerful new selector options//Alternating Itemsli:nth-child(odd) { color: blue; }li:nth-child(even) { color: green; }li:nth-child(3n) { color: red; } //Every 3rd item//First/Last Itemsli:first-of-type { color: blue; }li:not(:first-of-type):not(:last-of-type) { color: orange; } //All*but* first/last//Enabled/Disabledinput:enabled { border: 2px solid green; }input:disabled { background-color: #BBB; }*Use jQuery to support legacy browsers
Biggest problem withcustom fonts?21:02Licensing.(And then file format.)(And then performance.)(And then Comic Sans.)
Custom Fonts@font-face {font-family: Delicious;src: url('Delicious-Roman.otf') format(“opentype”);}//Usageh3 { font-family: Delicious, sans-serif; }
WebFont Providers+WOFF21:02
Borders, Backgrounds,Gradients, Shadows,Text Shadows, Colors21:02
-moz-border-radius: 5px 5px 5px 5px;-webkit-border-radius: 5px;border-radius: 5px;-moz-box-shadow: 2px 2px 2px #333;-webkit-box-shadow: 2px 2px 2px #333;box-shadow: 2px 2px 2px #333;-webkit-background-size: 137px 50px;-o-background-size: 137px 50px;background-size: 137px 50px;21:02
Two cautions:1. Older browsers2. Mobile Performance21:02
Media QueriesConditional CSS rules/sheetsbased on screen properties21:02
/*These two rules do the same thing*/@media all and (min-width:500px) { … }@media (min-width:500px) { … }/*Multiple conditions*/@media screen and (min-width: 600px) and (max-width: 900px) {.class {background: #333;}}
• width/height• device-width/height• aspect-ratio• orientation• color/color-index• resolution+media type & logical operators
LayoutsFlex & Grid21:02
The end of complicated float layouts.(Eventually.)
display: none;
21:02
Final Q&A
Thank You!
Your Feedback is ImportantPlease fill out a session evaluation using theEventBoard app.Thank you!

Recommended

PDF
HTML5--The 30,000' View (A fast-paced overview of HTML5)
PPT
Developing Java Web Applications
 
PDF
The Future Of Web Frameworks
PPTX
HATEOAS 101 - Opinionated Introduction to a REST API Style
PPTX
The Rich Standard: Getting Familiar with HTML5
PPTX
Edge of the Web
PDF
Usability in the GeoWeb
PDF
The web - What it has, what it lacks and where it must go - Istanbul
PDF
JavaScript Libraries: The Big Picture
PPTX
Web application framework
PDF
Vaadin and Spring at Devoxx UK 2015
PDF
XML and Web Services with Groovy
PDF
Web Standards
PPTX
HTML5 and CSS3 Techniques You Can Use Today
PPTX
Making HTML5 Work Everywhere
KEY
HTML5: A brave new world of markup
PDF
Keypoints html5
PDF
HTML5 Comprehensive Guide
PPTX
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
PPTX
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
PPTX
Swf search final
PDF
News From the Front Lines - an update on Front-End Tech
PDF
HTML5 and the dawn of rich mobile web applications
PPTX
Mobile applications for SharePoint using HTML5
PPTX
HTML5: The Next Internet Goldrush
KEY
jQuery Conference Boston 2011 CouchApps
PDF
What the heck is HTML 5?
PDF
Mobile applications development - why should you start learning it right now?
KEY
HTML CSS & Javascript
ODP
Introduction of Html/css/js

More Related Content

PDF
HTML5--The 30,000' View (A fast-paced overview of HTML5)
PPT
Developing Java Web Applications
 
PDF
The Future Of Web Frameworks
PPTX
HATEOAS 101 - Opinionated Introduction to a REST API Style
PPTX
The Rich Standard: Getting Familiar with HTML5
PPTX
Edge of the Web
PDF
Usability in the GeoWeb
PDF
The web - What it has, what it lacks and where it must go - Istanbul
HTML5--The 30,000' View (A fast-paced overview of HTML5)
Developing Java Web Applications
 
The Future Of Web Frameworks
HATEOAS 101 - Opinionated Introduction to a REST API Style
The Rich Standard: Getting Familiar with HTML5
Edge of the Web
Usability in the GeoWeb
The web - What it has, what it lacks and where it must go - Istanbul

What's hot

PDF
JavaScript Libraries: The Big Picture
PPTX
Web application framework
PDF
Vaadin and Spring at Devoxx UK 2015
PDF
XML and Web Services with Groovy
PDF
Web Standards
PPTX
HTML5 and CSS3 Techniques You Can Use Today
PPTX
Making HTML5 Work Everywhere
KEY
HTML5: A brave new world of markup
PDF
Keypoints html5
PDF
HTML5 Comprehensive Guide
PPTX
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
PPTX
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
PPTX
Swf search final
PDF
News From the Front Lines - an update on Front-End Tech
PDF
HTML5 and the dawn of rich mobile web applications
PPTX
Mobile applications for SharePoint using HTML5
PPTX
HTML5: The Next Internet Goldrush
KEY
jQuery Conference Boston 2011 CouchApps
PDF
What the heck is HTML 5?
PDF
Mobile applications development - why should you start learning it right now?
JavaScript Libraries: The Big Picture
Web application framework
Vaadin and Spring at Devoxx UK 2015
XML and Web Services with Groovy
Web Standards
HTML5 and CSS3 Techniques You Can Use Today
Making HTML5 Work Everywhere
HTML5: A brave new world of markup
Keypoints html5
HTML5 Comprehensive Guide
MongoDB.local Seattle 2019: MongoDB Stitch Tutorial
MongoDB.local Dallas 2019: MongoDB Stitch Tutorial
Swf search final
News From the Front Lines - an update on Front-End Tech
HTML5 and the dawn of rich mobile web applications
Mobile applications for SharePoint using HTML5
HTML5: The Next Internet Goldrush
jQuery Conference Boston 2011 CouchApps
What the heck is HTML 5?
Mobile applications development - why should you start learning it right now?

Viewers also liked

KEY
HTML CSS & Javascript
ODP
Introduction of Html/css/js
PDF
Get the Look and Feel You Want in Oracle APEX
PDF
Corejava ratan
PDF
HTML CSS JavaScript jQuery Training
PDF
Spring core module
PPTX
An Overview of HTML, CSS & Java Script
PDF
Durga soft scjp-notes-part-1-javabynataraj
PDF
Durga soft scjp-notes-part-2-javabynataraj
DOC
Html, xml and java script
DOC
Html refrence notes
PDF
Spring hibernate natraj
PPTX
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
PPT
HTML5 Mullet: Forms & Input Validation
PPT
Building RESTful Applications with OData
PDF
Using HTML5 to Build Mobile Apps
PDF
Hibernate complete notes_by_sekhar_sir_javabynatara_j
PDF
Hibernate natraj - satya
PDF
Webservises natraj -satya
PDF
Luxembourg in figures 2016
HTML CSS & Javascript
Introduction of Html/css/js
Get the Look and Feel You Want in Oracle APEX
Corejava ratan
HTML CSS JavaScript jQuery Training
Spring core module
An Overview of HTML, CSS & Java Script
Durga soft scjp-notes-part-1-javabynataraj
Durga soft scjp-notes-part-2-javabynataraj
Html, xml and java script
Html refrence notes
Spring hibernate natraj
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
HTML5 Mullet: Forms & Input Validation
Building RESTful Applications with OData
Using HTML5 to Build Mobile Apps
Hibernate complete notes_by_sekhar_sir_javabynatara_j
Hibernate natraj - satya
Webservises natraj -satya
Luxembourg in figures 2016

Similar to HTML5 Bootcamp: Essential HTML, CSS, & JavaScript

PDF
HTML5 & CSS3 refresher for mobile apps
PPTX
HTML5 introduction for beginners
PPTX
What is HTML 5?
PPT
Html5 Future of WEB
PDF
HTML5: An Introduction To Next Generation Web Development
PPTX
Html5 tutorial for beginners
ODP
Html5
PDF
[2015/2016] HTML5 and CSS3 Refresher
PPT
HTML5 Webinar - Mind Storm Software
PDF
HTML5 Refresher
PDF
HTML5 and CSS3 refresher
KEY
Introduction to HTML5/CSS3 In Drupal 7
PPT
Mobile Web Applications using HTML5 [IndicThreads Mobile Application Develop...
PPTX
HTML 5
PDF
A brief introduction on HTML5 and responsive layouts
PDF
Html5 workshop part 1
PDF
Speak the Web 15.02.2010
PPTX
Html5 today
 
PPTX
HTML5 for dummies
ODP
Html5
HTML5 & CSS3 refresher for mobile apps
HTML5 introduction for beginners
What is HTML 5?
Html5 Future of WEB
HTML5: An Introduction To Next Generation Web Development
Html5 tutorial for beginners
Html5
[2015/2016] HTML5 and CSS3 Refresher
HTML5 Webinar - Mind Storm Software
HTML5 Refresher
HTML5 and CSS3 refresher
Introduction to HTML5/CSS3 In Drupal 7
Mobile Web Applications using HTML5 [IndicThreads Mobile Application Develop...
HTML 5
A brief introduction on HTML5 and responsive layouts
Html5 workshop part 1
Speak the Web 15.02.2010
Html5 today
 
HTML5 for dummies
Html5

More from Todd Anglin

PPT
Building a Testable Data Access Layer
PPTX
HTML5 for Tablets and Mobile
PPTX
HTML5 and CSS3 Techniques You Can Use Today
PPTX
What’s New in ASP.NET 4
PDF
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
PPTX
Developing a Modern Mobile App Strategy
PPTX
Doing More with LESS for CSS
PPTX
5 Tips for Better JavaScript
PPTX
50in50: Resources for HTML5, CSS3, & JavaScript Developers
Building a Testable Data Access Layer
HTML5 for Tablets and Mobile
HTML5 and CSS3 Techniques You Can Use Today
What’s New in ASP.NET 4
NativeScript: Cross-Platform Mobile Apps with JavaScript and Angular
Developing a Modern Mobile App Strategy
Doing More with LESS for CSS
5 Tips for Better JavaScript
50in50: Resources for HTML5, CSS3, & JavaScript Developers

Recently uploaded

PDF
Unser Jahresrückblick – MarvelClient in 2025
PDF
Digit Expo 2025 - EICC Edinburgh 27th November
PDF
Day 3 - Data and Application Security - 2nd Sight Lab Cloud Security Class
PDF
ElyriaSoftware — Powering the Future with Blockchain Innovation
PDF
API-First Architecture in Financial Systems
PDF
Day 5 - Red Team + Blue Team in the Cloud - 2nd Sight Lab Cloud Security Class
PDF
Our Digital Tribe_ Cultivating Connection and Growth in Our Slack Community 🌿...
PDF
Internet_of_Things_IoT_for_Next_Generation_Smart_Systems_Utilizing.pdf
PDF
Session 1 - Solving Semi-Structured Documents with Document Understanding
PDF
GPUS and How to Program Them by Manya Bansal
PDF
Is It Possible to Have Wi-Fi Without an Internet Provider
PDF
Making Sense of Raster: From Bit Depth to Better Workflows
PDF
DevFest El Jadida 2025 - Product Thinking
PPTX
Coded Agents – with UiPath SDK + LangGraph [Virtual Hands-on Workshop]
PPTX
Kanban India 2025 | Daksh Gupta | Modeling the Models, Generative AI & Kanban
PDF
Decoding the DNA: The Digital Networks Act, the Open Internet, and IP interco...
PPTX
Protecting Data in an AI Driven World - Cybersecurity in 2026
PPTX
Data Privacy and Protection: Safeguarding Information in a Connected World
PPTX
Chapter 3 Introduction to number system.pptx
PPTX
Cybercrime in the Digital Age: Risks, Impact & Protection
Unser Jahresrückblick – MarvelClient in 2025
Digit Expo 2025 - EICC Edinburgh 27th November
Day 3 - Data and Application Security - 2nd Sight Lab Cloud Security Class
ElyriaSoftware — Powering the Future with Blockchain Innovation
API-First Architecture in Financial Systems
Day 5 - Red Team + Blue Team in the Cloud - 2nd Sight Lab Cloud Security Class
Our Digital Tribe_ Cultivating Connection and Growth in Our Slack Community 🌿...
Internet_of_Things_IoT_for_Next_Generation_Smart_Systems_Utilizing.pdf
Session 1 - Solving Semi-Structured Documents with Document Understanding
GPUS and How to Program Them by Manya Bansal
Is It Possible to Have Wi-Fi Without an Internet Provider
Making Sense of Raster: From Bit Depth to Better Workflows
DevFest El Jadida 2025 - Product Thinking
Coded Agents – with UiPath SDK + LangGraph [Virtual Hands-on Workshop]
Kanban India 2025 | Daksh Gupta | Modeling the Models, Generative AI & Kanban
Decoding the DNA: The Digital Networks Act, the Open Internet, and IP interco...
Protecting Data in an AI Driven World - Cybersecurity in 2026
Data Privacy and Protection: Safeguarding Information in a Connected World
Chapter 3 Introduction to number system.pptx
Cybercrime in the Digital Age: Risks, Impact & Protection

HTML5 Bootcamp: Essential HTML, CSS, & JavaScript

Editor's Notes

  • #4 Bogus chart – based on “research” by Wiman &amp; Meirhenry, and Edgar Dale 1960Research since proven to be made-up. Still, fun slide and anecdotally true…DEBUNKING:http://www.willatworklearning.com/2006/05/people_remember.htmlhttp://www.conversionrate.com.au/2008/06/16/retention-myth-people-remember-50-of-what-they-see-and-hear-and-only-10-of-what-they-read/
  • #11 Felix jumped 24 miles in 4 minutes at 834 mph (1342 km/h)
  • #12 This session will not focus much on Backend technology - like ASP.NET.HTML5, CSS3, JavaScript are the metal of the web. It&apos;s the front-end development technologies.
  • #16 http://www.apple.com/hotnews/thoughts-on-flash/
  • #17 Talk about the major “platforms” for the web. Introduce the players.
  • #21 Kendo UI survey of 4,000 developers revealed that HTML5 will be important to 82% of jobs in 2012.All believe will be be important within next 12 to 24 months.Research by Gartner, Forrester, ComScore, Vision Mobile all confirm the idea that HTML5&apos;s importance is unavoidable.
  • #26 Ground Hogs DayHaven’t we been here before? Haven’t we bought-in to the ideals of HTML/JS/Web only to be burned by browsers?What’s different about today? Or are we letting the groundhog drive us off a cliff?
  • #27 http://dev.w3.org/html5/html4-differences/Goes on to say:The same goes for XHTML1, which defines an XML serialization for HTML4, and DOM Level 2 HTML, which defines JavaScript APIs for both HTML and XHTML. HTML5 will replace these documents.
  • #29 http://en.wikipedia.org/wiki/HTML
  • #30 http://en.wikipedia.org/wiki/Cascading_Style_SheetsIE Mac: Shipped in March 2000First browser to 100% support CSS: IE on Mac!9 style sheet languages proposed in early 90sLanguages:1996:JavaScript Style Sheets (JSSS) – Netscape1994: Cascading HTML Style Sheets (CHSS)1994: Stream-based Style Sheet Proposal (SSP)
  • #33 WHATWG FAQs on Living Standard: http://wiki.whatwg.org/wiki/FAQ#What_does_.22Living_Standard.22_mean.3F
  • #34 Trick question: Common answers will be the popular browsers.Right answer: The browsers that YOUR users use (based on analytics)
  • #36 Source: http://marketshare.hitslink.com/browser-market-share.aspx?qprid=0&amp;qpcustomd=0&amp;qptimeframe=QUpdated: March 2014
  • #37 Browser VersionsUpdated: March 2014
  • #41 Mobile browsers are just as important for today&apos;s web developer.
  • #44 What is the IE strategy for HTML5/CSS3?
  • #45 On Microsoft’s strategy/approach to HTML5:http://blogs.msdn.com/b/ie/archive/2010/12/20/html5-site-ready-and-experimental.aspxhttp://blogs.msdn.com/b/interoperability/archive/2010/12/21/prototyping-early-w3c-html5-specifications.aspx
  • #46 http://html5labs.interoperabilitybridges.com/http://www.beautyoftheweb.comInteroperability Bridges offers IE9 extensions for: FileAPI, IndexedDB, WebSockets, Video Captioning, Media Capture API (getUserMedia)
  • #48 Scores from HTML5Test.com (updated Oct 2013)
  • #49 Sun Spider benchmark test:http://www.webkit.org/perf/sunspider/sunspider.html
  • #50 Show off some HTML5 in action
  • #51 This is not a question with a single correct answer. It all depends on your audience and strategy.There are several general strategies for defining what is “usable” today.
  • #54 Useful for adding HTML5 to both older browsers + new browsers that do not have a specific HTML5 featurehttp://remysharp.com/2010/10/08/what-is-a-polyfill/https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills
  • #57 Strategy: Design for lowest common denominator, Enrich/Enhance as more capabilities are availableImage Source: http://www.flickr.com/photos/aaronolaf/833342657/
  • #58 Strategy: Design for best case scenario (premium features), and gracefully remove features as resources are not availableImage Source: http://www.mbusa.com/mercedes/index
  • #60 I want it now!How do you use HTML5 today?
  • #61 Modern adoption of HTML5 is done by checking for individual feature support, NOT by checking for specific browsers/browser versions. This helps you adopt as much of HTML5 as possible in a progressively optimistic manner.
  • #62 http://www.modernizr.com/
  • #63 http://www.modernizr.comhttp://www.alistapart.com/articles/taking-advantage-of-html5-and-css3-with-modernizr/Modernizr now ships with ASP.NET MVC 3
  • #65 Chrome Framehttp://code.google.com/chrome/chromeframe/Let&apos;s you use Chrome browser engine in IE 6/7/8/9chrome=1   - Always activechrome=IE7 - Active for IE major version 7 or lowerchrome=IE8 - Active for IE major version 8 or lower
  • #66 Scores from HTML5Test.com (updated Oct 2012)
  • #67 he HTML5 specification will not be considered finished before there are at least two complete implementations of the specification.http://www.w3.org/TR/html5-diff/#backwards-compatibleThe Living Standard: http://www.whatwg.org/specs/web-apps/current-work/multipage/
  • #71 Important to define the scope and vastness of HTML5
  • #72 Focusing on features most popular in use today by HTML5 developers. Sources:http://css-tricks.com/poll-results-html5-features-in-use-on-production-sites/http://css.dzone.com/articles/what-are-most-common-html5
  • #74 HTML5 &amp; CSS3 in VS2010 SP1: http://madskristensen.net/post/HTML5-CSS3-in-Visual-Studio-2010-SP1.aspxHTML5 in VS2008: http://stackoverflow.com/questions/1682180/will-visual-studio-2010-support-html-5
  • #75 Demo End Result Goal
  • #76 Starting Point for the Demo
  • #77 http://www.w3.org/TR/html5/text-level-semantics.htmlhttp://media.smashingmagazine.com/cdn_smash/wp-content/uploads/images/html5-cheat-sheet/html5-cheat-sheet.pdfhttp://gsnedders.html5.org/outlinerhttp://diveintohtml5.org/examples/blog-original.htmlhttp://visualstudiogallery.msdn.microsoft.com/en-us/d771cbc8-d60a-40b0-a1d8-f19fc393127d
  • #80 http://www.javascriptkit.com/dhtmltutors/customattributes.shtmlhttp://html5doctor.com/html5-custom-data-attributes/Two methods of access:- Via Attributes (http://api.jquery.com/category/attributes/)Via “dataset” (plug-in required today: http://www.orangesoda.net/jquery.dataset.html)
  • #83 Chrome H.264 from MSFT:http://arstechnica.com/microsoft/news/2011/02/microsoft-offers-h264-plugin-for-chrome-queries-google-on-webm.arshttp://blogs.msdn.com/b/ie/archive/2011/02/01/html5-and-web-video-questions-for-the-industry-from-the-community.aspxChrome’s pull of H.264: http://arstechnica.com/web/news/2011/01/googles-dropping-h264-from-chrome-a-step-backward-for-openness.ars/
  • #85 WebM support via a plug-in: http://tools.google.com/dlpage/webmmfTechCrunch on WebM: http://techcrunch.com/2011/01/14/webm-plugins/
  • #86 http://blog.nihilogic.dk/2009/02/html5-canvas-cheat-sheet.htmlhttp://libcanvas.github.com/
  • #87 http://code.google.com/p/explorercanvas/
  • #88 http://upload.wikimedia.org/wikipedia/en/d/d0/Chrome_Logo.svgComparison articles:Great comparison: http://dev.opera.com/articles/view/svg-or-canvas-choosing-between-the-two/http://blogs.sitepoint.com/2010/07/06/canvas-vs-svg-how-to-choose/ (IDEA: progressive enhancement techniques — for example, IE8 and earlier versions show a table of data whereas supported browsers show an animated pie chart.)SVG Bridge for all browsers:http://raphaeljs.com/CANVAS Bridge for IE: http://code.google.com/p/explorercanvas/(Pointless canvas example: http://paulirish.com/2010/high-res-browser-icons/)SVG is DOM-based. All elements exist in DOM. Thus, you can attach event handlers. CON: Many objects can hurt perf.CANVAS is PIXEL-based. All elements rendered quickly, but not part of DOM. CON: Harder to interact.
  • #90 http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#states-of-the-type-attributehttp://www.html5laboratory.com/s/simple-html5-contact-form.htmlWeb Forms 2 (old spec – now Forms in HTML5): http://dev.w3.org/html5/web-forms-2/http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#formsDefined input types: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#the-input-elementCross browser input types: http://net.tutsplus.com/tutorials/html-css-techniques/how-to-build-cross-browser-html5-forms/Cross browser forms 2.0: https://github.com/westonruter/webforms2
  • #91 Useful articles:http://www.alistapart.com/articles/forward-thinking-form-validation/https://developer.mozilla.org/en/HTML/HTML5/Forms_in_HTML5#Constraint_Validation_APIhttp://www.the-art-of-web.com/html/html5-form-validation/
  • #92 Link to demo from A List Apart (good final cap demo on validation)
  • #93 iOS varies the keyboard significantly on the iPhone depending on the input typeShown: iOS5 (not available in iOS4)
  • #95 http://diveintohtml5.org/forms.htmlPolyfills for other HTML5 features:http://ericleads.com/h5validate/
  • #97 Consuming certain HTML5 features RAW is a bad idea. It can be done, but better if “cooked” with some assistive code.
  • #100 http://diveintohtml5.org/geolocation.htmlSpec: http://dev.w3.org/geo/api/spec-source.htmlOnly lat, long, acc are guranteed. Other values might be available, including altitude, altitudeAccuracy, heading, speedCan force maximum age for cached geolocation objectsCan handle errors and make repeat location calls using navigatior.geolocation.watchPosition(successCallback, errorCallback, {maximumAge:time})Google Maps API v3 Reference: http://code.google.com/apis/maps/documentation/javascript/basics.html(Free to use on all apps that are free to consumers – no API keys needed)
  • #103 http://html5demos.com/storageTutorial:http://html5tutorial.net/tutorials/working-with-html5-localstorage.htmlFallback for older browsers: http://amplifyjs.com/api/store/
  • #104 Same Origin Policy for JS securityhttps://developer.mozilla.org/en/Same_origin_policy_for_JavaScript
  • #107 http://www.html5rocks.com/en/tutorials/dnd/basics/
  • #112 http://dev.w3.org/html5/postmsg/http://ajaxian.com/archives/cross-window-messaging-with-html-5-postmessageOnline demo: http://html5demos.com/postmessage2Availability: http://caniuse.com/#search=messaging
  • #115 http://html5demos.com/offlineapphttp://diveintohtml5.org/offline.htmlhttp://html5doctor.com/go-offline-with-application-cache/ (Good practical tips)Inspect appcache in Chrome: chrome://appcache-internals/Stephen Walther on using ASP.NET to serve Cache manifest: http://stephenwalther.com/blog/archive/2011/01/26/creating-html5-offline-web-applications-with-asp-net.aspxFix IIS Express manifest type: http://www.danielroot.info/2010/07/how-microsofty-writes-ipad-apps.htmlC:\Users\{YOU}\Documents\IISExpress\config\applicationHost.configComment out the .manifest mime type (sorry ClickOnce!)Add the following line: &lt;mimeMapfileExtension=&quot;.manifest&quot; mimeType=&quot;text/cache-manifest&quot; /&gt;Can also override in IIS7+ config (integrated pipeline):&lt;system.webServer&gt; &lt;staticContent&gt; &lt;mimeMapfileExtension=&quot;.manifest&quot; mimeType=&quot;text/cache-manifest&quot; /&gt; &lt;/staticContent&gt; &lt;/system.webServer&gt;Application Cache API: http://www.w3.org/TR/html5/offline.html#application-cache-api
  • #118 WebSql is not proceeding: http://dev.w3.org/html5/webdatabase/State of web local storage: http://rethink.unspace.ca/2010/5/10/the-state-of-html5-local-data-storageReplacement Tech is IndexedDB:http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.htmlSyncing back to a server database: http://stackoverflow.com/questions/1744522/best-way-to-synchronize-local-html5-db-storage-with-a-serverPersistenceJS:https://github.com/zefhemel/persistencejsGoogle Web Stroage Portability Layer: http://google-opensource.blogspot.com/2009/05/web-storage-portability-layer-common.html
  • #119 Kills Google Gearshttp://www.w3.org/TR/IndexedDB/https://developer.mozilla.org/en/IndexedDBhttp://www.html5rocks.com/tutorials/indexeddb/todo/Good comparison by Mozilla to formerWebDatabase approach: http://hacks.mozilla.org/2010/06/comparing-indexeddb-and-webdatabase/
  • #122 Example code for .NET WebSockets:http://www.undisciplinedbytes.com/2010/06/html-5-c-web-sockets-server-and-asp-net-client-implementation/Online demo: http://websocket.org/echo.htmlOpera on Sockets:http://my.opera.com/core/blog/websocketsSockets disabled by default in FF and Opera: http://annevankesteren.nl/2010/12/websocket-protocol-vulnerabilityEnabling sockets in Opera 11: opera:config#UserPrefs|EnableWebSocketsEnabling sockets in FF4: about:config -&gt; network.websocket.override-security-block;trueIE9 can do WebSockets via a prototype Silverlight hack: http://html5labs.interoperabilitybridges.com/prototypes/available-for-download/websocketsLimits: http://html5labs.interoperabilitybridges.com/media/2311/readme.htmSockets vs. traditional polling performance: http://soa.sys-con.com/node/13154733rd party sockets solution for older browsers:
  • #126 File API: http://www.w3.org/TR/file-upload/http://www.html5rocks.com/en/tutorials/file/dndfiles/Demo: http://html5demos.com/file-api
  • #129 http://en.wikipedia.org/wiki/Web_Workershttp://www.whatwg.org/specs/web-workers/current-work/http://caniuse.com/#search=web worker
  • #130 History API: https://developer.mozilla.org/en/DOM/Manipulating_the_browser_historyA &quot;saner&quot; path forward? PathChange event: http://www.adequatelygood.com/2010/7/Saner-HTML5-History-Management
  • #134 POST LUNCH SLEEPhttp://understanding-sleep-disorders.com/images/bigstockphoto_Man_Asleep_On_Laptop_With_Cup__5671.jpg
  • #136 Chrome Camera App + Chrome OSFirefox OSWindows 8Browser SPAWebsite
  • #142 Chrome OS Camera app
  • #147 The goal of a SPA is to provide a more fluid, desktop app like experience using web standardsTerm &quot;SPA&quot; coined by Steve Yen in 2005, though concept has existed for much longer
  • #150 SPA examples: Gmail, Google Docs, iCloud
  • #151 Overcome the limits of HTML5Use proxy tools like Cordova (the open source variant of PhoneGap)Available APIs listed in Greenhttp://docs.phonegap.com/en/1.7.0/index.html
  • #152 More explanation:http://phonegap.com/2012/05/02/phonegap-explained-visually/
  • #157 JavaScript 101
  • #160 AGENDA:- Why JavaScript? Why?!- Most Common JS Problems- TIPS- Future of JavaScript
  • #161 JavaScript uses syntax influenced by that of C. JavaScript copies many names and naming conventions from Java, but the two languages are otherwise unrelated and have very different semantics. The key design principles within JavaScript are taken from the Self and Scheme programming languages.http://en.wikipedia.org/wiki/JavaScript
  • #165 NOTES:HistoryEvolutionThe IE Connection (IE6 memory)Modern JS EnginesBOTTOM LINE: Only Cross Platform Language Solution
  • #166 Netscape also wanted a lightweight interpreted language that would complement Java by appealing to nonprofessional programmers, like Microsoft&apos;s VB
  • #167 Credit: Brendan Eich via WikipediaSource: http://www.jwz.org/blog/2010/10/every-day-i-learn-something-new-and-stupid/#comment-1021Brendan further said that JavaScript saved the world from VBScripthttp://www.jwz.org/blog/2010/10/every-day-i-learn-something-new-and-stupid/#comment-1049
  • #168 Java is to JavaScriptASCar is to CarpetNetscape was going to release JavaScript as “LiveScript.” Last minute change produced JavaScript.
  • #169 HOW DID JAVASCRIPT BECOME UBIQUITOUS?Netscape shipped first in Netscape 2Microsoft support added in IE3 (“JScript”)Other environments adopted JavaScript-like script languages: ActionScript (Flash), PDFs, Qt
  • #170 http://www.codinghorror.com/blog/2007/05/javascript-the-lingua-franca-of-the-web.html
  • #172 Contributing factors:New JS engines (V8)CPU speed (more local processing power)Better debugging toolsBetter understanding of language (closures, patterns, functional programming, JSLint)
  • #173 Chrome is 10x faster than IE7 (IE6 too old to test)Used crude relative test: http://jsbenchmark.celtickane.com
  • #174 http://geekmontage.com/firefox-vs-chrome-vs-ie/
  • #175 http://www.codinghorror.com/blog/2007/07/the-principle-of-least-power.htmlThe Principle of Least Power
  • #179 Jordan Ilchev, Icenium Team LeadIvan Ivanov, Sr DeveloperBurke Holland, Evangelist, Kendo UIJohn Bristowe, Evangelist, Kendo UITsvetomirTsonev, Sr Developer, Kendo UI
  • #180 jQuery built for convenience, not for performance.PERF PROOF: http://jsperf.com/id-vs-class-vs-tag-selectors/46Note: This in general is applicable to native JavaScript methods too, like document.getElementById()  not limited to jQuery only objects DOM lookups are slow especially if DOM is huge.Instead of this:$(&apos;#test&apos;).bind(&apos;click&apos;, function() { /**/ });$(&apos;#test&apos;).css(&apos;border&apos;, &apos;1px solid #999&apos;);Better use jQuery Method chaining:$(&apos;#test&apos;).bind(&apos;click&apos;, function() {/**/ })                 .css(&apos;border&apos;, &apos;1px solid #999&apos;);Or cache jQuery object:var $test = $(&apos;#test&apos;);$test.bind(&apos;click&apos;, function() {/**/ });$test.css(&apos;border&apos;, &apos;1px solid #999&apos;);(Performance comparison here: http://jsperf.com/jquery-chaining/12) (~+30% here, but it stacks on each additional method call)
  • #181 PRO TIP CONVENTION: Name jQuery variables with $ (ie $myObject)PERF TEST: http://jsperf.com/caching-jquery-objects-perfhttp://jsbin.com/udizam/2
  • #182 PERF TEST: http://jsperf.com/for-vs-foreach-vs-each/3- Caching the array length improves perf by about 15% (http://jsperf.com/for-vs-foreach-vs-each/24)- Technically a reverse (count down) for loop is faster (15%) than count-up loop, but much harder to read/use
  • #183 Global variables pollute the JS app and are slower to use in code. Harder to be a good JS &quot;neighbor&quot; with global variables (collide with other JS code).Better to use local variables, cached variable, or closures
  • #184 Chart credit: http://oreilly.com/server-administration/excerpts/even-faster-websites/writing-efficient-javascript.htmlPERF TEST: http://jsperf.com/global/2
  • #185 Global memory garbage collecting problem example: http://fiddle.jshell.net/toddanglin/EhEBM/3/show/light/
  • #191 Pattern sometimes referred to as: MODULE EXPORThttp://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-DepthBE CAREFUL WITH CLOSURES: Most common source of memory leaks in modern appshttps://developers.google.com/speed/articles/optimizing-javascriptCircular Reference Memory Leaks: http://blogs.msdn.com/b/ericlippert/archive/2003/09/17/53028.aspx
  • #192 Pattern sometimes referred to as: MODULE EXPORThttp://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-DepthBE CAREFUL WITH CLOSURES: Most common source of memory leaks in modern appshttps://developers.google.com/speed/articles/optimizing-javascriptCircular Reference Memory Leaks: http://blogs.msdn.com/b/ericlippert/archive/2003/09/17/53028.aspx
  • #193 PERF TEST: http://jsperf.com/prototype-vs-closures/20Explanation of term: http://benalman.com/news/2010/11/immediately-invoked-function-expression/Suppose you develop a widget. The widget has a number of axillary classes. If you just define them globally they will pollute the global window class, meaning they will be available from everywhere. Instead consider the following definition:             (function (window) {                        function classA () {}                        function classB () {}                                               function myWidget () {}                        myWidget.prototype.method1 = function ()                        {                        }                                               window.myWidget = myWidget;                                   }) (window, undefined); This is the pattern which jQuery follows. Now the only available global definition will be of myWidget. classA and classB remain hidden in the anonymous function. If you look closely in the definition, you will see the that window and undefined are passed to the anonymous function. Passing anonymous guaranties that undefined will be available in the scope of this function and will prevent you from someone who accidentally did something like: undefined = true; before your function. Also, if you use some minifier, it will replace all occurrences of window with some shorter name. Of course you can pass as much params as you wish, thus assuring that these objects exist in the scope of your anonymous function.
  • #194 - Binding to delegates is less brittle, easier to avoid memory leaks- Pub/Sub is super flexible, less coupling
  • #195 The scope of an inline event bind is GLOBAL!Inline event handlers can also cause memory leaks in IE: https://developers.google.com/speed/articles/optimizing-javascript
  • #196 Old jQuery syntax: .delegate
  • #197 Every time you need to dispose a DOM element, make sure you unbind all of its events, unless you want to come up with a memory leak.Whenever you bind an event handler to an event, you tell the processor to allocate memory for it. The more event handlers you have running at the same time, the more memory you are using. This is why it&apos;s important to unbind or detach your event handlers soon as you no longer need them.http://www.learnjquery.org/newsletter/Tutorial-3-jquery-events.html
  • #198 Event listening PUB/SUB
  • #202 Reducing the time spent changing the DOM improvesperf. Using templates improves readability/maintainability.Instead of this:var $list = $(&apos;#mylist&apos;).append(&apos;&lt;ul&gt;&apos;);for (var i = 0, l = itemlist.length; i &lt; l; i++) {       $list.append(&apos;&lt;li&gt;&apos; + itemlist[i] + &apos;&lt;/li&gt;&apos;);}better this:var $list = $(&apos;&lt;ul&gt;&apos;);for (var i = 0, l = itemlist.length; i &lt; l; i++) {       $list.append(&apos;&lt;li&gt;&apos; + itemlist[i] + &apos;&lt;/li&gt;&apos;);}$(&apos;#mylist&apos;).append($list);(Performance comparison here: http://jsperf.com/jquery-dom-manipulation/3) (up to x5 in this case)
  • #206 PERF TEST: http://jsperf.com/jquery-dom-manipulation/4When you want to dynamically build html, prefer string concatenation like: var html = ’&lt;p&gt;some paragraph&lt;/p&gt;’;html += ‘&lt;p&gt;another paragraph&lt;/p&gt;’;$(“#placeHolder”).html(html); over DOM object creation and appending/prepending like:             var p1 = document.createElement(&apos;p&apos;);            p1.innerHTML = &quot;some paragraph&quot;;            document.body.appendChild(p1);             var p2 = document.createElement(&apos;p’);            p2.innerHTML = &quot;another paragraph&quot;;            document.body.appendChild(p2);      assigning directly to the innerHTML proves to be the fastest method for html creation.
  • #207 PERF TEST: http://jsperf.com/jquery-dom-manipulation/5
  • #208 Common Examples:RequireJS, CommonJSApplications of any size are painful to manage without a module pattern.
  • #209 We want to reduce JavaScript files for performance (fewer network requests), BUT…One large JS file is hard to maintain. We&apos;d really prefer more modular files.
  • #212 JSLint – by Douglas CrockfordCode quality tool for JavaScripthttp://www.jslint.com/
  • #213 Defer first implemented in IE 4!Non-blocking script references
  • #214 async overrides defer (when available)Scripts loaded async/defer shouldn’t modify the DOM or do any document.writeUSE ASYNC to avoid waiting on 3rd party scripts to loadUSE DEFER to improve parallel script downloadingScripts are executed before DOMContentLoaded / window.onload
  • #217 More complete fix by Paul Irish: http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
  • #222 Triathlon meme/moment
  • #223 Before CSS:Styles were mixed with HTML tags (difficult to update, difficult to read)Layout was defined with HTML tags (poor semantic use of tags)
  • #224 CSS exists to separate styling and layout decisions from structural meaning of underlying document*Separation of concerns to a degreeCSS rules often tend to create dependencies on HTMLOther benefits of CSS:Performance (caching of CSS rules)Semantic HTML
  • #225 Peter Griffin CSS cartoon
  • #227 http://en.wikipedia.org/wiki/Cascading_Style_SheetsIE Mac: Shipped in March 20009 style sheet languages proposed in early 90sLanguages:1996:JavaScript Style Sheets (JSSS) – Netscape1994: Cascading HTML Style Sheets (CHSS)1994: Stream-based Style Sheet Proposal (SSP)
  • #228 Extensions for CSS2.1Add functionality, refine definitionsNew CSS3 featuresCSS3 principlesShow example of CSS3 in actionList of all CSS properties:http://meiert.com/en/indices/css-properties/http://www.w3.org/Style/CSS/current-workhttp://www.w3.org/TR/2010/WD-css-2010-20101202/#css3
  • #229 CSS3’s evolutionary approachMicrosoft is focusing primarily on adding product support at the Candidate Recommendation stageReview status of various CSS3 proposed specs: http://www.w3.org/Style/CSS/current-workUpdated: Oct 2012
  • #230 Microsoft Extensions: http://blogs.msdn.com/b/ie/archive/2008/09/08/microsoft-css-vendor-extensions.aspxVendor specific prefixes: http://reference.sitepoint.com/css/vendorspecific
  • #235 http://html5reset.org/http://meyerweb.com/eric/tools/css/reset/http://html5doctor.com/html-5-reset-stylesheet/http://html5boilerplate.com/
  • #236 CSS Selectors over time (1, 2, 3) - As of Nov 2011
  • #240 @font-face was first proposed for CSS2 and has been implemented in Internet Explorer since version 5IE relied on proprietary Embedded Open Type (.eot)Old school solutions involved things like sIFR (http://www.mikeindustries.com/blog/sifr/)Modern browsers finally support TTF and OTF + Most support new WOFF (exception is Safari)Resources:http://www.css3.info/preview/web-fonts-with-font-face/http://www.alistapart.com/articles/cssatten
  • #242 Making fonts compatible with IE requires some work-around:http://randsco.com/index.php/2009/07/04/p680\Discussion of WOFF:http://en.wikipedia.org/wiki/Web_Open_Font_Format
  • #243 Demo: http://slides.html5rocks.com/#flex-box-1
  • #247 Fix “bleeding” in Webkit with: -webkit-background-clip: padding-box;http://tumble.sneak.co.nz/post/928998513/fixing-the-background-bleedhttp://css3pie.com/
  • #248 Relatively new CSS standard defining Gradients: http://www.w3.org/TR/css3-images/IMAGES FROM: http://www.webdesignerwall.com/tutorials/cross-browser-css-gradient/Great visual CSS gradient generator: http://www.display-inline.fr/projects/css-gradient/#startType=hex&amp;startValue=aaeeff&amp;endType=hex&amp;endValue=3399ccSimple Visual gradient creator: http://gradients.glrzad.com/Good explanation:http://www.dynamicdrive.com/style/csslibrary/item/css3_linear_gradients/background: black;background: -moz-linear-gradient(top, black, white);background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(black), to(white)); /*You can also make gradient stops*/-moz-linear-gradient( top,rgb(214,24,166) 0%,rgb(255,51,200) 50%,rgb(255,77,240) 87%)
  • #250 Illustrate media query adapting (video?)
  • #251 http://www.webdesignerwall.com/tutorials/css3-media-queries/http://www.w3.org/TR/css3-mediaqueries/http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/
  • #252 http://www.webdesignerwall.com/tutorials/css3-media-queries/http://www.w3.org/TR/css3-mediaqueries/http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/
  • #253 Not currently supported in IE9CSS3 Animation Examples:http://webdeveloperjuice.com/demos/css/css3effects.html#secondhttp://anthonycalzadilla.com/css3-ATAT/index.htmlhttp://www.optimum7.com/css3-man/animation.html
  • #256 http://www.webdesignerwall.com/tutorials/css3-media-queries/http://www.w3.org/TR/css3-mediaqueries/http://www.w3.org/TR/2010/CR-css3-mediaqueries-20100727/
  • #258 Mind Blown

[8]ページ先頭

©2009-2025 Movatter.jp