SlideShare a Scribd company logo
1 of 95
Download to read offline
Modern web
development
• Web standards
• Semantics
• Separating layers
• Unobtrusive JavaScript
• Performance
Web standards
What are web standards?
There aren’t any Web Standards,
    only Recommendations
“A W3C Recommendation is a specification
or set of guidelines that, after extensive
consensus-building, has received the
endorsement of W3C Members and the
Director. W3C recommends the wide
deployment of its Recommendations.”
                                   – W3C
• Valid HTML/XHTML code
• Semantically correct code
• Separation of content, presentation
  and interaction
DOCTYPEs decide rendering mode
• Quirks Mode
• Standards Mode
  (HTML 5: No Quirks Mode)


• Almost Standards Mode
  (HTML 5: "Limited Quirks Mode")


• IE 7 Mode
  ("mostly" a frozen copy of the mode that was the standards mode in IE7)


• XML Mode
  For the application/xhtml+xml Content-Type (not available in Internet
  Explorer)
• Strict doctypes render Standards Mode
• Transitional XHTML doctypes render
  Almost Standards Mode
• Other/No doctypes render Quirks Mode
Activating Browser Modes with Doctype
Semantics
“I have a dream for the Web [in which
computers] become capable of analyzing all
the data on the Web – the content, links, and
transactions between people and
computers.”
                    – Tim Berners-Lee, 1999
• Use meaningful names and elements
• Applies to all code
<table cellspacing="0" cellpadding="0">

 <tr>


 
 <td class="heading">SWDC</td>


 </tr>


 <tr>


 
 <td>Content</td>


 </tr>

</table>
<div class="heading">SWDC</div>

<div class="content">Content</div>
<h1>SWDC</h1>

<p>Content</p>
<h2 class="h3">News</h2>
<h2 class="additional-content">News</h2>
<div class="additional-content">


 <h2>News</h2>

</div>
<div class="left">


 Navigation

</div>

<div class="right">


 Content

</div>
<div class="navigation">


 Navigation

</div>

<div class="main-content">


 Content

</div>
Separating layers
• HTML (content)
• CSS (presentation)
• JavaScript (interaction)
Why separating layers?
• Code maintainability
• Overview
• Structure
• Performance
<div style="color: red">


 Very important

</div>
<div class="important">


 Very important

</div>
Unobtrusive JavaScript
• No JavaScript code in the HTML code
• No inline events on elements
• Progressive enhancement
<a href="javascript:doStuff()">

 Magic
</a>
<a href="#" onclick="doStuff(); return
false">

 Magic
</a>
<a href="stuff.html" onclick="doStuff();
return false">

 Magic
</a>
<a href="stuff.html" class="magic">

 Magic
</a>
window.onload = function () {

 var magic =
getElementsByClassName("magic");

    for (var i=0, l=magic.length; i<l; i++) {

    
   magic.onclick = function () {

    
   
    doStuff();

    
   
    return false;

    
   };

    }
};
JavaScript-dependent elements should be
        generated with JavaScript
var link = document.createElement("a");

link.innerHTML = "Get more content";

link.onclick = function () {


    // JavaScript magic

};

document.body.appendChild(link);
Why it should work
without JavaScript
A little case study of Sony Ericsson
JavaScript available
No JavaScript
<!-- SonyEricsson logo code -->

<div id="selogo" class="floatleft"
onclick="document.location.href='/cws/
home?lc=sv&cc=se';" style="cursor:
pointer;">

 <img src="/cws/images/spacer.gif"
style="height: 30px; width: 155px;"
alt="Sony Ericsson"/>

</div>
JavaScript available
No JavaScript
Google result
Performance
• CSS sprites
• Image optimizing
• gzip
• Expires headers
• ETags
• Deployment configuration
CSS Sprites
• Combine several images into one
• Position through CSS
.save {


 background: url(sprite.png) no-repeat 0 0;

}

.delete {


 background: url(sprite.png) no-repeat 0 -100px;

}

.info {


 background: url(sprite.png) no-repeat 0 -200px;

}
Upload images, get sprite and CSS:

      CSS Sprite Generator
Image optimizing
• Combines many open-source optimizers
• Lossless compression
• Removing superfluous metadata
DN.se
DN.se start page:

Could save 370 kb/unique page load

Has 1 186 730 unique visitors/week


370 * 1 186 730 ≈ 418 GB per week!
smusher
• Commandline through smush.it API
  for whole folders
Smush.it now part of YSlow for Firebug
gzip:
 • Apache: mod_deflate
 • IIS 7: HTTP Compression
# Alternative 1

AddOutputFilterByType DEFLATE text/html text/
plain text/css text/javascript application/x-
javascript


# Alternative 2

SetOutputFilter DEFLATE
DeflateFilterNote ratio
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|PNG)$ 
     no-gzip dont-vary
SetEnvIfNoCase Request_URI 
     .(?:exe|t?gz|zip|bz2|sit|rar)$ 
     no-gzip dont-vary
SetEnvIfNoCase Request_URI .pdf$ no-gzip dont-
vary
Expires headers:
• Apache: mod_expires
• IIS 7: HTTP Expires
# Alternative 1

ExpiresActive   On
ExpiresByType   text/css "access plus 3 days"
ExpiresByType   application/x-javascript "access
plus 3 days"
ExpiresByType   image/gif "access plus 3 days"
ExpiresByType   image/png "access plus 3 days"
ExpiresByType   image/jpeg "access plus 3 days"


# Alternative 2

ExpiresActive On
ExpiresDefault "access plus 3 days
Setting/removing ETags:
• Apache: FileETag     MTime Size
   alternatively FileETag none
• For IIS: Mdutil.exe
JavaScript deployment:
• Concatenating
• Minifying
Concatenating:
•   cat jquery.js base.js > all.js

• Concatenate Text Files using C#
Minifying:
• JSMin
• YUI Compressor
Building Web Applications With Apache Ant
Autokatalogen.se
DN.se
Yahoo!
• Best Practices for Speeding Up
   Your Web Site
Tools
Firebug
YSlow
HTML Validator
Inline Code Finder
Firefinder
Obstacles
Redmond...
Acid2 Test
• 31 October 2005: 
 Safari 2.0.2
• 28 March 2006: 
 
 Konqueror 3.5.2
• 20 June 2006: 

 
 Opera 9.0
• 17 June 2008: 

 
 Mozilla Firefox 3.0
• 19 March 2009: 
 
 Internet Explorer 8
Acid3 Test
•   DOM Level 2 Traversal (subtests 1-6)                   •   Unicode 5.0 UTF-16 (subtest 68)


•   DOM Level 2 Range (subtests 7-11)                      •   Unicode 5.0 UTF-8 (subtest 70)


•   Content-Type: image/png; text/plain (subtest 14, 15)   •   HTML 4.0 Transitional (subtest 71)


•   <object> handling and HTTP status codes (subtest 16)   •   HTML 4.01 Strict


•   DOM Level 2 Core (subtests 17, 21)                     •   SVG 1.1 (subtests 74, 78)


•   DOM Level 2 Events (subtests 17, 30-32)                •   SVG 1.1 Fonts (subtests 77, 79)


•   CSS Selectors (subtests 33-40)                         •   SMIL 2.1 (subtests 75-76)


•   DOM Level 2 Style (subtest 45)                         •   ECMAScript Conformance (subtests 81-96)


•   DOM Level 2 HTML (subtest 60)                          •   Data URI scheme (subtest 97)


•   DOM Level 2 Views                                      •   XHTML 1.0 Strict (subtest 98)


•   ECMAScript GC (subtests 26-27)                         •   HTTP 1.1 Protocol
• Safari                 • Firefox
  
 3.2.3: 

 77/100       
 3.0.10:
 71/100
  
 4 beta: 
 100/100      
 3.5 beta: 
94/100

• Chrome                 • Internet Explorer
  
 1.0: 
 
 79/100        
 8:
 
 
 20/100
  
 2 beta: 
 100/100      
 No beta

• Opera
  
 9.64:
 
 85/100
  
 10 beta: 
 100/100
Doctypes & rendering
Rendering by voting
IE8 and the X-UA-Compatible situation
Multiple IE
Summary
• Web standards
• Semantics
• Separating layers
• Unobtrusive JavaScript
• Performance
Robert Nyman
                                robert@robertnyman.com
                                    robertnyman.com

Images:

          http://www.flickr.com/photos/mringlein/316476217/

          http://blog.tmcnet.com/blog/tom-keating/movabletype/movable-type-vs-wordpress-war-heats-up.asp

          http://www.yardbarker.com/other_sports/articles/LIST_BEST_Players_to_ever_wear_the_number/292924

          http://jimberkin.wordpress.com/2007/09/19/yet-another-reason-i-hate-lawyers/

          http://share-sports.3ds.com/2008/03/31/philippe-fuchs-tunes-workouts-for-better-results-with-heart-rate-variability-monitoring/

          http://hsivonen.iki.fi/doctype/ie8-mode.png

          http://www.stalepopcorn.co.uk/competitions/win-stuff-the-neverending-story-on-dvd/

More Related Content

What's hot

What's hot (20)

Java Script ppt
Java Script pptJava Script ppt
Java Script ppt
 
Intro to HTML and CSS basics
Intro to HTML and CSS basicsIntro to HTML and CSS basics
Intro to HTML and CSS basics
 
Front end web development
Front end web developmentFront end web development
Front end web development
 
WEB I - 01 - Introduction to Web Development
WEB I - 01 - Introduction to Web DevelopmentWEB I - 01 - Introduction to Web Development
WEB I - 01 - Introduction to Web Development
 
ppt of web development for diploma student
ppt of web development for diploma student ppt of web development for diploma student
ppt of web development for diploma student
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
Web development tool
Web development toolWeb development tool
Web development tool
 
Web development | Derin Dolen
Web development | Derin Dolen Web development | Derin Dolen
Web development | Derin Dolen
 
Web development
Web developmentWeb development
Web development
 
Introduction to back-end
Introduction to back-endIntroduction to back-end
Introduction to back-end
 
HTML, CSS And JAVASCRIPT!
HTML, CSS And JAVASCRIPT!HTML, CSS And JAVASCRIPT!
HTML, CSS And JAVASCRIPT!
 
Html / CSS Presentation
Html / CSS PresentationHtml / CSS Presentation
Html / CSS Presentation
 
Google Chrome DevTools features overview
Google Chrome DevTools features overviewGoogle Chrome DevTools features overview
Google Chrome DevTools features overview
 
Html5 tutorial for beginners
Html5 tutorial for beginnersHtml5 tutorial for beginners
Html5 tutorial for beginners
 
jQuery
jQueryjQuery
jQuery
 
Front end development session1
Front end development session1Front end development session1
Front end development session1
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 
jQuery
jQueryjQuery
jQuery
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScript
 

Similar to Modern Web Development

Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)
johnnybiz
 
CTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowCTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should Know
Spiffy
 
High performance website
High performance websiteHigh performance website
High performance website
Chamnap Chhorn
 

Similar to Modern Web Development (20)

Ease into HTML5 and CSS3
Ease into HTML5 and CSS3Ease into HTML5 and CSS3
Ease into HTML5 and CSS3
 
Html5 more than just html5 v final
Html5  more than just html5 v finalHtml5  more than just html5 v final
Html5 more than just html5 v final
 
Break out of The Box - Part 2
Break out of The Box - Part 2Break out of The Box - Part 2
Break out of The Box - Part 2
 
HTML5 History & Features
HTML5 History & FeaturesHTML5 History & Features
HTML5 History & Features
 
Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
Intro JavaScript
Intro JavaScriptIntro JavaScript
Intro JavaScript
 
Html forfood
Html forfoodHtml forfood
Html forfood
 
CTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowCTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should Know
 
HTML5: An Overview
HTML5: An OverviewHTML5: An Overview
HTML5: An Overview
 
Html5 n css3
Html5 n css3Html5 n css3
Html5 n css3
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8
 
Generating the Server Response: HTTP Status Codes
Generating the Server Response: HTTP Status CodesGenerating the Server Response: HTTP Status Codes
Generating the Server Response: HTTP Status Codes
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
 
Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government Developers
 
performance.ppt
performance.pptperformance.ppt
performance.ppt
 
High performance website
High performance websiteHigh performance website
High performance website
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with Rails
 
Performance (browser)
Performance (browser)Performance (browser)
Performance (browser)
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 

More from Robert Nyman

More from Robert Nyman (20)

Have you tried listening?
Have you tried listening?Have you tried listening?
Have you tried listening?
 
Building for Your Next Billion - Google I/O 2017
Building for Your Next Billion - Google I/O 2017Building for Your Next Billion - Google I/O 2017
Building for Your Next Billion - Google I/O 2017
 
Introduction to Google Daydream
Introduction to Google DaydreamIntroduction to Google Daydream
Introduction to Google Daydream
 
Predictability for the Web
Predictability for the WebPredictability for the Web
Predictability for the Web
 
The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of Progressive Web Apps - View Source conference, Berlin 2016The Future of Progressive Web Apps - View Source conference, Berlin 2016
The Future of Progressive Web Apps - View Source conference, Berlin 2016
 
The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016The Future of the Web - Cold Front conference 2016
The Future of the Web - Cold Front conference 2016
 
The Future of Progressive Web Apps - Google for Indonesia
The Future of Progressive Web Apps - Google for IndonesiaThe Future of Progressive Web Apps - Google for Indonesia
The Future of Progressive Web Apps - Google for Indonesia
 
Google tech & products
Google tech & productsGoogle tech & products
Google tech & products
 
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
Introduction to Progressive Web Apps, Google Developer Summit, Seoul - South ...
 
Progressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
Progressive Web Apps keynote, Google Developer Summit, Tokyo, JapanProgressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
Progressive Web Apps keynote, Google Developer Summit, Tokyo, Japan
 
The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...The web - What it has, what it lacks and where it must go - keynote at Riga D...
The web - What it has, what it lacks and where it must go - keynote at Riga D...
 
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
The web - What it has, what it lacks and where it must go - Bulgaria Web Summ...
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - Istanbul
 
The web - What it has, what it lacks and where it must go
The web - What it has, what it lacks and where it must goThe web - What it has, what it lacks and where it must go
The web - What it has, what it lacks and where it must go
 
Google, the future and possibilities
Google, the future and possibilitiesGoogle, the future and possibilities
Google, the future and possibilities
 
Developer Relations in the Nordics
Developer Relations in the NordicsDeveloper Relations in the Nordics
Developer Relations in the Nordics
 
What is Developer Relations?
What is Developer Relations?What is Developer Relations?
What is Developer Relations?
 
Android TV Introduction - Stockholm Android TV meetup
Android TV Introduction - Stockholm Android TV meetupAndroid TV Introduction - Stockholm Android TV meetup
Android TV Introduction - Stockholm Android TV meetup
 
New improvements for web developers - frontend.fi, Helsinki
New improvements for web developers - frontend.fi, HelsinkiNew improvements for web developers - frontend.fi, Helsinki
New improvements for web developers - frontend.fi, Helsinki
 
Mobile phone trends, user data & developer climate - frontend.fi, Helsinki
Mobile phone trends, user data & developer climate - frontend.fi, HelsinkiMobile phone trends, user data & developer climate - frontend.fi, Helsinki
Mobile phone trends, user data & developer climate - frontend.fi, Helsinki
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Modern Web Development