SlideShare a Scribd company logo
HTML validation, microformats, jQuery WebTechNY 8 October 2008 Jeffrey Barke  . Senior Developer / Information Architect
New York Web Standards Meetup
Topics covered in 2008 Google Maps API Version targeting and IE 8 Web Samurai errata for Web Content Accessibility Guidelines 1.0 Microformats WAI-ARIA Ajax Cloud computing jQuery Version control with Subversion  HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
New York Web Standards Meetup http://webstandards.meetup.com/118/ HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
HTML validation
HTML validation The W3C Markup Validation Service checks web documents for conformance to HTML and XHTML standards. Located at  http://validator.w3.org/ While valid markup does not guarantee a page will render successfully cross-browser, it makes it easier to ensure that it does, that CSS will be correctly applied and that JavaScript will function correctly. All HTML user agents have extremely lenient error handling. While it is relatively consistent between browsers, there are plenty of differences in the edge cases and the error handling behavior is not documented or part of any standard. HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
DOCTYPE A DOCTYPE (Document Type Declaration) associates a document with a Document Type Definition (DTD). Originally it was conceived to determine the type of document, but it is not actually suitable for this. However, having a correct DOCTYPE is still important: Your document won't validate without one. Essential for the proper rendering and functioning of documents in modern browsers HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
DOCTYPE “sniffing” and layout modes HTML layout engines use DOCTYPE "sniffing" on documents served as text/html to determine a layout mode. While there are multiple modes, many of which are browser-specific, the two major modes are "quirks mode" and "standards mode.“ In the standards mode the browsers try to give conforming documents the specification-wise correct treatment to the extent implemented in a particular browser. Since different browsers are at different stages of compliance, the Standards mode isn’t a single target, either. HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
DOCTYPE “sniffing” and layout modes (cont’d) In quirks mode, attempts are made to emulate the behavior of older browsers. This includes the Internet Explorer box model bug. Obviously, we want to be in standards mode: <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
HTML, XML and XHTML &quot;Understanding HTML, XML and XHTML&quot; by Maciej Stachowiak  http://webkit.org/blog/68/understanding-html-xml-and-xhtml/ HTML was originally an application of SGML. As actually used on the web, HTML is best described as a custom language influenced by SGML. XHTML is a reformulation of HTML in XML syntax. HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
HTML, XML and XHTML (cont’d) What determines if a document is HTML or XHTML? None of the following: Using an XHTML doctype declaration Putting an XML declaration at the top Using XHTML-specific syntax like self-closing tags Validating it as XHTML Only the MIME type. And the vast majority of documents are served as  text/html , not  application/xhtml+xml  or  text/xml . HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
Validation and its discontents “ 'HTML validation' is a good tool, but just a tool” by Jukka &quot;Yucca&quot; Korpela  http:// www.cs.tut.fi/~jkorpela/html/validation.html : Although there is really not much to be gained from using XHTML at present, many people have started using it. Then it becomes relevant that validation means different things for XHTML. The reason is that the metalanguage, XML, is considerably less powerful than SGML. For example, the XML DTD for XHTML 1.0 declares the tabindex attribute as CDATA, which allows virtually anything. In the SGML DTDs of &quot;old&quot; HTML, the attribute is declared as NUMBER. This means that in validating against &quot;old&quot; HTML, tabindex=&quot;-1&quot; is reported as an error (as it is), in XHTML validation it passes. On the other hand, XML imposes restrictions that forbid constructs that are formally correct in SGML-based HTML but not actually supported by browsers, such as the shorthand <em/text/ for <em>text</em>, and this means that XHTML validation is pragmatically more useful in some ways. HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
Validation and its discontents (cont’d) “ 'HTML validation' is a good tool, but just a tool” by Jukka &quot;Yucca&quot; Korpela  http:// www.cs.tut.fi/~jkorpela/html/validation.html : It's useful to write valid markup, in most cases. But it's hardly useful to make a noise about it. Analogously, it's useful to use proper punctuation when you write in English. This makes texts somewhat easier to read and understand, and it adds to the literary quality a bit. There are slightly different styles of punctuation, and you should choose one and stick to it. But it's hardly useful to make a noise thereof. Would you like to include an icon like &quot;Checked SGUFDFY 42.5!&quot; onto your pages and expect users to decipher that SGUFDFY 42.5 means some particular convention on punctuation? HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
Validation and its discontents (cont’d) “ Martian Headsets” by Joel Spolsky  http://www.joelonsoftware.com/items/2008/03/17.html : In the real world where people are imperfect, you can’t have a standard with just a spec–you  must have  a super-strict reference implementation, and everybody has to test against the reference implementation. Otherwise you get 17 different “standards” and you might as well not have one at all.  HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
What it all means Use the HTML 4 DOCTYPE declaration. Serve content with the  text/html  MIME type. Validate content as HTML, not XHTML.  Do not use “Valid HTML” icons. HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
References “ Quirks mode and strict mode”:  http:// www.quirksmode.org/css/quirksmode.html “ Activating Browser Modes with Doctype”:  http://hsivonen.iki.fi/doctype/ “ Fix Your Site With the Right DOCTYPE!” Jeffrey Zeldman:  http:// www.alistapart.com/articles/doctype / HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
Microformats
What are microformats? Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards. –Dan Cedarholm with Tantek Çelik for launch of microformats.org Microformats are simple conventions for embedding semantics in HTML to enable decentralized development. –from the mailing list Microformats are carefully designed (X)HTML class names that extend the semantics of (X)HTML and enable authors to publish higher semantic fidelity content such as people, events, reviews, etc. –Tantek Çelik Microformats are a way of identifying and labeling classes of commonly used data that make it easier for humans or computers to locate or distribute such information on websites. –Dave Sanford Source:  http://microformats.org/wiki/what-are-microformats HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
What are microformats? (cont’d) A microformat (sometimes abbreviated μF or uF) is a web-based data formatting approach that seeks to re-use existing content as metadata, using only XHTML and HTML classes and other attributes. This approach is intended to allow information intended for end-users (such as contact information, geographic coordinates, calendar events, and the like) to also be automatically processed by software. Source:  http:// en.wikipedia.org/wiki/Microformats HTML validation, microformats, jQuery  •   WebTechNY / 8 October 2008
Why use microformats? Aggregation sites The general model is the user travels to a particular site, and then proceeds to enter data (classified add, review, list of friends) for a particular purpose. Your information is scattered all over the Web, and you have to pick which sites you want to use. The combination of blogging and microformats is now reversing this model. Now, your information remains in your blog, and the Web sites come to you. For instance, if you want to sell something, you can blog about it using an hListing, and a site like edgeio will find it when it aggregates classified advertisements across the Web. Source:  http://blog.mozilla.com/faaborg/2006/12/11/microformats-part-0-introduction/ Introduction to Microformats  •   WebTechNY / 8 October 2008
Why use microformats? (cont’d) Sharing information with a specific community Let’s say you enjoy mountain biking, and would like to share various trails with other people who also enjoy mountain biking. If you posted this information to your blog, you could geocast (RSS with a payload of geo), the locations of the mountain bike trails, and other people in the community could subscribe to this feed using an application like Google Earth. Targeted search Let’s say you are creating a web comic, and you want other people to be able to find it. By posting your comic with a microformat agreed upon by the web comic community, the rest of the community will be able to easily find your work using a search engine.  Source:  http://blog.mozilla.com/faaborg/2006/12/11/microformats-part-0-introduction/ Introduction to Microformats  •   WebTechNY / 8 October 2008
Why use microformats? (cont’d) CSS convenience Use semantic classes for styling instead of ad-hoc names: “Why invent your own class names when you can re-use pre-defined ones that give your site extra functionality for free?” Enhanced user experience (with the proper browser or plugins) Version 3 of the Firefox as well as version 8 of Internet Explorer are expected to include native support for microformats Ability to leverage markup for your own uses (we’ll see an example of this later) Introduction to Microformats  •   WebTechNY / 8 October 2008
Who’s creating the microformats? Microformats emerged as part of a grassroots movement to make recognizable data items (such as events, contact details or geographical locations) capable of automated processing by software, as well as directly readable by end-users. As the microformats community grew, CommerceNet, a nonprofit organization that promotes electronic commerce on the Internet, helped sponsor and promote the technology and support the microformats community in various ways. CommerceNet also helped co-found the microformats community site microformats.org. Source:  http:// en.wikipedia.org/wiki/Microformats Introduction to Microformats  •   WebTechNY / 8 October 2008
Who’s creating the microformats? (cont’d) Neither CommerceNet nor Microformats.org is a standards body. The microformats community is an open wiki, mailing list, and Internet relay chat (IRC) channel. Most of the existing microformats were created at the Microformats.org wiki and associated mailing list, by a process of gathering examples of web publishing behaviour, then codifying it. Some other microformats (such as rel=nofollow and unAPI) have been proposed, or developed, elsewhere. Some names associated with microformats:  Dan Cedarholm Tantek Çelik Drew McLellan Eric A. Meyer Source:  http:// en.wikipedia.org/wiki/Microformats Introduction to Microformats  •   WebTechNY / 8 October 2008
Where the specs are located and how to get involved Blog:  http://microformats.org/ Wiki:  http:// microformats.org/wiki/Main_Page Email list:  http://microformats.org/discuss/ IRC:  irc://irc.freenode.net#microformats Introduction to Microformats  •   WebTechNY / 8 October 2008
Using microformats
Microformat specifications and drafts http://microformats.org/wiki/Main_Page#Specifications The ones I use: Specifications hCalendar hCard rel-license rel-nofollow rel-tag  Drafts adr geo Introduction to Microformats  •   WebTechNY / 8 October 2008
hCard hCard is a simple, open, distributed format for representing people, companies, organizations, and places, using a 1:1 representation of vCard (RFC2426) properties and values in semantic HTML or XHTML Spec:  http://microformats.org/wiki/hcard Probably easiest way to learn the format is by example:  http://microformats.org/code/hcard/creator The root class name for an hCard is &quot;vcard&quot;. An element with a class name of &quot;vcard&quot; is itself called an  hCard .  Introduction to Microformats  •   WebTechNY / 8 October 2008
hCalendar hCalendar is a simple, open, distributed calendaring and events format, based on the iCalendar standard (RFC2445), suitable for embedding in HTML or XHTML, Atom, RSS, and arbitrary XML. Spec:  http:// microformats.org/wiki/hcalendar Probably easiest way to learn the format is by example:  http:// microformats.org/code/hcalendar/creator Note–the  dtstart  and  dtend  classes must be applied to  abbr  elements. DATE_FORMAT(startdate, '%Y-%m-%dT%H:%i:00') AS startdate Introduction to Microformats  •   WebTechNY / 8 October 2008
Rel-License Rel-License is a simple, open, format for indicating content licenses which is embeddable in HTML or XHTML, Atom, RSS, and arbitrary XML Spec:  http:// microformats.org/wiki/rel -license Rel-License is one of several MicroFormats. By adding  rel=&quot;license&quot;  to a hyperlink, a page indicates that the destination of that hyperlink is a license for the current page. E.g. with the following hyperlink: <a href=&quot;http://creativecommons.org/licenses/by/2.0/&quot; rel=&quot;license&quot;>cc by 2.0</a> the author indicates that the page is licensed under a Creative Commons 2.0 Attribution Required license. Multiple such  rel=&quot;license&quot;  hyperlinks indicate that the page is available under any of the referred licenses. E.g. the following hyperlinks could be used to declare that a page is available under either a Creative Commons 2.0 Attribution Required license or the Apache 2.0 license. Introduction to Microformats  •   WebTechNY / 8 October 2008
Rel-License (cont’d) Creative Commons license chooser:  http:// creativecommons.org /license/ Dreamweaver Extension suite ( http:// www.webstandards.org/action/dwtf/microformats / ) from  the Web Standards Project ( http:// webstandards.org / ) enables the authoring of rel-license links from within Dreamweaver 8. Includes (cc) defaults.  Introduction to Microformats  •   WebTechNY / 8 October 2008
Rel-Tag Spec:  http:// microformats.org/wiki/rel -tag By adding  rel=&quot;tag&quot;  to a hyperlink, a page indicates that the destination of that hyperlink is an author-designated &quot;tag&quot; (or keyword/subject) for the current page. Note that a tag may just refer to a major portion of the current page (i.e. a blog post). e.g. by placing this link on a page, <a href=&quot;http://technorati.com/tag/tech&quot; rel=&quot;tag&quot;>tech</a> the author indicates that the page (or some portion of the page) has the tag &quot;tech&quot;.  The linked page SHOULD exist, and it is the linked page, rather than the link text, that  defines the tag. The last path component of the URL is the text of the tag, so <a href=&quot;http://technorati.com/tag/tech&quot; rel=&quot;tag&quot;>fish</a> would indicate the tag &quot;tech&quot; rather than &quot;fish&quot;.  Introduction to Microformats  •   WebTechNY / 8 October 2008
Consuming microformats
Tools for reading microformats Firefox extensions: Operator A microformat detection extension developed by Michael Kaply at IBM. https://addons.mozilla.org/en-US/firefox/addon/4106 Tails The first microformat detection extension for Firefox by Robert de Bruin. http://blog.codeeg.com/tails-firefox-extension-03/ Source:  http://labs.mozilla.com/2006/12/introducing-operator/ Introduction to Microformats  •   WebTechNY / 8 October 2008
Tools for reading microformats (cont’d) Operator builds on Tails Export by having a user interface that is based around actions the user can take, instead of data types. Operator also includes support for the microformats geo and rel-tag, and is compatible with Firefox 3. Address book + Operator Blog  post tag + Operator Maps + Operator Calendar + Operator Introduction to Microformats  •   WebTechNY / 8 October 2008
Building your own applications on microformats Great tutorial on mapping microformats with jQuery at 24 ways:  http://24ways.org/2007/unobtrusively-mapping-microformats-with-jquery Unobtrusive JavaScript jQuery Google Maps API Mapstraction  http://24ways.org/examples/unobtrusively-mapping-microformats-with-jquery/restaurants-plain.html http://24ways.org/examples/unobtrusively-mapping-microformats-with-jquery/restaurants.html Introduction to Microformats  •   WebTechNY / 8 October 2008
Some sites that use microformats Flickr Meetup.com Technorati Upcoming.org Yahoo! Local Introduction to Microformats  •   WebTechNY / 8 October 2008
Microformat buttons http:// www.factorycity.net/projects/microformats -icons/ http:// microformats.org/wiki/buttons Introduction to Microformats  •   WebTechNY / 8 October 2008
jQuery
What is jQuery? jQuery is a JavaScript library. One among many: Protoype Dojo Toolkit MooTools jQuery is one of the newer JavaScript libraries. It was released in January 2006 by John Resig, author of Pro JavaScript Techniques. It’s a fast, lightweight library that emphasizes the interaction between HTML and JavaScript using CSS-style selectors. Has a great development community. Microsoft and Nokia intend to bundle jQuery on their platforms. HTML validation, microformats and jQuery  •   WebTechNY / 8 October 2008
Why jQuery? JavaScript libraries make it faster and easier to develop distinctive JavaScript applications. No reason to roll your JS library from scratch or worry about handling cross-browser Ajax quirks. http:// en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks HTML validation, microformats and jQuery  •   WebTechNY / 8 October 2008
DOM scripting without and with jQuery var external_links = document.getElementById('external_links'); var links = external_links.getElementsByTagName('a'); for (var i=0;i < links.length;i++) { var link = links.item(i); link.onclick = function() { return confirm('You are going to visit: ' + this.href); }; } $('#external_links a').click(function() { return confirm('You are going to visit: ' + this.href); }); HTML validation, microformats and jQuery  •   WebTechNY / 8 October 2008
Another example: zebra-striping with jQuery $(‘table tr:nth-child(even)’).addClass(‘striped’); $() returns a JavaScript object containing an array of DOM elements that match the selector. ‘ table tr’ would return all table rows. :nth-child(n|odd|even) returns a specific child or all the even or odd children. .addClass adds the specified class or class name to the wrapped set. HTML validation, microformats and jQuery  •   WebTechNY / 8 October 2008
Getting jQuery Two methods: Download jQuery from  http://docs.jquery.com/Downloading_jQuery , upload to your web server and add a script element to the page. Use the Google Ajax Libraries API:  http://code.google.com/apis/ajaxlibs/ Which is better? HTML validation, microformats and jQuery  •   WebTechNY / 8 October 2008
Google Ajax Libraries API Caching is done correctly, and once, by Google. Developers don’t have to do anything. Gzipped Google serves minified versions The files are hosted by Google which has a distributed CDN at various points around the world, so the files are &quot;close&quot; to the user The servers are fast By using the same URLs, if a critical mass of applications use the Google infrastructure, when someone comes to your application the file may already be loaded. A subtle performance (and security) issue revolves around the headers that you send up and down. Since you are using a special domain (NOTE: not google.com!), no cookies or other verbose headers will be sent up, saving precious bytes. HTML validation, microformats and jQuery  •   WebTechNY / 8 October 2008
Next steps Documentation and tutorials at the jQuery site:  http://docs.jquery.com/Tutorials jQuery in Action. Bear Bibeault and Yehuda Katz. Manning. 2008. “ Simplify Ajax development with jQuery.” Jesse Skinner.  http://www.ibm.com/developerworks/library/x-ajaxjquery.html 15 Days of jQuery:  http://15daysofjquery.com/ Scott Trudeau’s (Apartment Therapy Media) “Introduction to Kicking Ass with jQuery”:  http://webstandards.meetup.com/118/calendar/8689977/ HTML validation, microformats and jQuery  •   WebTechNY / 8 October 2008

More Related Content

PDF
HTML5 & CSS3 in Drupal (on the Bayou)
KEY
Introduction to HTML5/CSS3 In Drupal 7
PPTX
SharePoint 2010 Web Standards & Accessibility
PDF
HTML standards
PDF
Webcomponents v2
PPT
HTML 5 Overview
PPT
Html5 basics
HTML5 & CSS3 in Drupal (on the Bayou)
Introduction to HTML5/CSS3 In Drupal 7
SharePoint 2010 Web Standards & Accessibility
HTML standards
Webcomponents v2
HTML 5 Overview
Html5 basics

What's hot (20)

PDF
HTML5--The 30,000' View (A fast-paced overview of HTML5)
PPT
Lecture 6 Data Driven Design
PDF
Rails Girls - Introduction to HTML & CSS
ODP
Moving from Web 1.0 to Web 2.0
PDF
Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>
PDF
What the heck is HTML 5?
PPT
Lecture 9 Professional Practices
PPT
Decoding the Web
PDF
HTML5 and XHTML2
PPTX
Chapter 2 introduction to html5
PDF
Web Standards
PPTX
HTML5 and Search Engine Optimization (SEO)
PPTX
HTML5 & CSS3
PDF
Web Standards: Fueling Innovation [Web Design World Boston '08]
PPT
Chapter14
PPT
Lecture1 B Frames&Forms
PPT
Lecture 9 Accessibility Original
PDF
EECI2009 - From Design to Dynamic - Rapid ExpressionEngine Development
PPTX
About html
PPT
Web 2.0 - what is it?
HTML5--The 30,000' View (A fast-paced overview of HTML5)
Lecture 6 Data Driven Design
Rails Girls - Introduction to HTML & CSS
Moving from Web 1.0 to Web 2.0
Essential Javascript -- A Javascript &lt;b>Tutorial&lt;/b>
What the heck is HTML 5?
Lecture 9 Professional Practices
Decoding the Web
HTML5 and XHTML2
Chapter 2 introduction to html5
Web Standards
HTML5 and Search Engine Optimization (SEO)
HTML5 & CSS3
Web Standards: Fueling Innovation [Web Design World Boston '08]
Chapter14
Lecture1 B Frames&Forms
Lecture 9 Accessibility Original
EECI2009 - From Design to Dynamic - Rapid ExpressionEngine Development
About html
Web 2.0 - what is it?
Ad

Viewers also liked (20)

PPT
PPTX
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
KEY
Bring a Web Page Alive with jQuery
PPT
Advanced php
PDF
OWASP AppSec USA 2011 - Dismantling Web Malware
ODP
Web Security
PDF
RedHat-System Administration I - RH124
ODP
A brief look inside UML
PDF
ClueCon2009: The Security Saga of SysAdmin Steve
PPT
Anatomy of Fraud (2010 & 2013)
PDF
jQuery: Events, Animation, Ajax
PPT
Web Technology – Web Server Setup : Chris Uriarte
PPT
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
PPTX
PHP Security Tips
PDF
jQuery Stack Overflow DevDays DC 2009
PDF
UpsilonPiEpsilon-UniversityOfBridgeport-May1997
PDF
Safety LAMP: data security & agile languages
KEY
jQuery Plugins Intro
PDF
Scalable Internet Servers and Load Balancing
PPT
OWASP App Sec US - 2010
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Bring a Web Page Alive with jQuery
Advanced php
OWASP AppSec USA 2011 - Dismantling Web Malware
Web Security
RedHat-System Administration I - RH124
A brief look inside UML
ClueCon2009: The Security Saga of SysAdmin Steve
Anatomy of Fraud (2010 & 2013)
jQuery: Events, Animation, Ajax
Web Technology – Web Server Setup : Chris Uriarte
Identifying Web Servers: A First-look Into the Future of Web Server Fingerpri...
PHP Security Tips
jQuery Stack Overflow DevDays DC 2009
UpsilonPiEpsilon-UniversityOfBridgeport-May1997
Safety LAMP: data security & agile languages
jQuery Plugins Intro
Scalable Internet Servers and Load Balancing
OWASP App Sec US - 2010
Ad

Similar to HTML validation, microformats, jQuery (20)

PPTX
Web topic 13 html validation tools
PPS
PDF
Rc064 010d Core Html 1
PPSX
PPTX
Lecture 4 - Adding XTHML for the Web
PDF
xhtml-documentation
PDF
xhtml-documentation
PPT
PDF
Microformats or: How I Learned to Write POSH and Love the Semantic Web
PPTX
LIS3353 SP12 Week 8
PPTX
IS221__Week1_Lecture chapter one, Web design.pptx
PPT
Microformats 101 Workshop
PPT
Wt-UNNIT-1 (1).ppt
PDF
HTML5, just another presentation :)
PDF
WT Module-1.pdf
PDF
Microformats I: What & Why
PDF
Oreilly -html_and_xhtml_pocket_reference_%28_december_2009%29_%28at_tica%29_1
PDF
PPTX
PPTX
Markup language classification, designing static and dynamic
Web topic 13 html validation tools
Rc064 010d Core Html 1
Lecture 4 - Adding XTHML for the Web
xhtml-documentation
xhtml-documentation
Microformats or: How I Learned to Write POSH and Love the Semantic Web
LIS3353 SP12 Week 8
IS221__Week1_Lecture chapter one, Web design.pptx
Microformats 101 Workshop
Wt-UNNIT-1 (1).ppt
HTML5, just another presentation :)
WT Module-1.pdf
Microformats I: What & Why
Oreilly -html_and_xhtml_pocket_reference_%28_december_2009%29_%28at_tica%29_1
Markup language classification, designing static and dynamic

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
A Presentation on Artificial Intelligence
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Machine Learning_overview_presentation.pptx
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
The AUB Centre for AI in Media Proposal.docx
Unlocking AI with Model Context Protocol (MCP)
A Presentation on Artificial Intelligence
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Machine Learning_overview_presentation.pptx
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
sap open course for s4hana steps from ECC to s4
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25-Week II
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm

HTML validation, microformats, jQuery

  • 1. HTML validation, microformats, jQuery WebTechNY 8 October 2008 Jeffrey Barke . Senior Developer / Information Architect
  • 2. New York Web Standards Meetup
  • 3. Topics covered in 2008 Google Maps API Version targeting and IE 8 Web Samurai errata for Web Content Accessibility Guidelines 1.0 Microformats WAI-ARIA Ajax Cloud computing jQuery Version control with Subversion HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 4. New York Web Standards Meetup http://webstandards.meetup.com/118/ HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 6. HTML validation The W3C Markup Validation Service checks web documents for conformance to HTML and XHTML standards. Located at http://validator.w3.org/ While valid markup does not guarantee a page will render successfully cross-browser, it makes it easier to ensure that it does, that CSS will be correctly applied and that JavaScript will function correctly. All HTML user agents have extremely lenient error handling. While it is relatively consistent between browsers, there are plenty of differences in the edge cases and the error handling behavior is not documented or part of any standard. HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 7. DOCTYPE A DOCTYPE (Document Type Declaration) associates a document with a Document Type Definition (DTD). Originally it was conceived to determine the type of document, but it is not actually suitable for this. However, having a correct DOCTYPE is still important: Your document won't validate without one. Essential for the proper rendering and functioning of documents in modern browsers HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 8. DOCTYPE “sniffing” and layout modes HTML layout engines use DOCTYPE &quot;sniffing&quot; on documents served as text/html to determine a layout mode. While there are multiple modes, many of which are browser-specific, the two major modes are &quot;quirks mode&quot; and &quot;standards mode.“ In the standards mode the browsers try to give conforming documents the specification-wise correct treatment to the extent implemented in a particular browser. Since different browsers are at different stages of compliance, the Standards mode isn’t a single target, either. HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 9. DOCTYPE “sniffing” and layout modes (cont’d) In quirks mode, attempts are made to emulate the behavior of older browsers. This includes the Internet Explorer box model bug. Obviously, we want to be in standards mode: <!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01//EN&quot; &quot;http://www.w3.org/TR/html4/strict.dtd&quot;> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;> HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 10. HTML, XML and XHTML &quot;Understanding HTML, XML and XHTML&quot; by Maciej Stachowiak http://webkit.org/blog/68/understanding-html-xml-and-xhtml/ HTML was originally an application of SGML. As actually used on the web, HTML is best described as a custom language influenced by SGML. XHTML is a reformulation of HTML in XML syntax. HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 11. HTML, XML and XHTML (cont’d) What determines if a document is HTML or XHTML? None of the following: Using an XHTML doctype declaration Putting an XML declaration at the top Using XHTML-specific syntax like self-closing tags Validating it as XHTML Only the MIME type. And the vast majority of documents are served as text/html , not application/xhtml+xml or text/xml . HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 12. Validation and its discontents “ 'HTML validation' is a good tool, but just a tool” by Jukka &quot;Yucca&quot; Korpela http:// www.cs.tut.fi/~jkorpela/html/validation.html : Although there is really not much to be gained from using XHTML at present, many people have started using it. Then it becomes relevant that validation means different things for XHTML. The reason is that the metalanguage, XML, is considerably less powerful than SGML. For example, the XML DTD for XHTML 1.0 declares the tabindex attribute as CDATA, which allows virtually anything. In the SGML DTDs of &quot;old&quot; HTML, the attribute is declared as NUMBER. This means that in validating against &quot;old&quot; HTML, tabindex=&quot;-1&quot; is reported as an error (as it is), in XHTML validation it passes. On the other hand, XML imposes restrictions that forbid constructs that are formally correct in SGML-based HTML but not actually supported by browsers, such as the shorthand <em/text/ for <em>text</em>, and this means that XHTML validation is pragmatically more useful in some ways. HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 13. Validation and its discontents (cont’d) “ 'HTML validation' is a good tool, but just a tool” by Jukka &quot;Yucca&quot; Korpela http:// www.cs.tut.fi/~jkorpela/html/validation.html : It's useful to write valid markup, in most cases. But it's hardly useful to make a noise about it. Analogously, it's useful to use proper punctuation when you write in English. This makes texts somewhat easier to read and understand, and it adds to the literary quality a bit. There are slightly different styles of punctuation, and you should choose one and stick to it. But it's hardly useful to make a noise thereof. Would you like to include an icon like &quot;Checked SGUFDFY 42.5!&quot; onto your pages and expect users to decipher that SGUFDFY 42.5 means some particular convention on punctuation? HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 14. Validation and its discontents (cont’d) “ Martian Headsets” by Joel Spolsky http://www.joelonsoftware.com/items/2008/03/17.html : In the real world where people are imperfect, you can’t have a standard with just a spec–you must have a super-strict reference implementation, and everybody has to test against the reference implementation. Otherwise you get 17 different “standards” and you might as well not have one at all. HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 15. What it all means Use the HTML 4 DOCTYPE declaration. Serve content with the text/html MIME type. Validate content as HTML, not XHTML. Do not use “Valid HTML” icons. HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 16. References “ Quirks mode and strict mode”: http:// www.quirksmode.org/css/quirksmode.html “ Activating Browser Modes with Doctype”: http://hsivonen.iki.fi/doctype/ “ Fix Your Site With the Right DOCTYPE!” Jeffrey Zeldman: http:// www.alistapart.com/articles/doctype / HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 18. What are microformats? Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards. –Dan Cedarholm with Tantek Çelik for launch of microformats.org Microformats are simple conventions for embedding semantics in HTML to enable decentralized development. –from the mailing list Microformats are carefully designed (X)HTML class names that extend the semantics of (X)HTML and enable authors to publish higher semantic fidelity content such as people, events, reviews, etc. –Tantek Çelik Microformats are a way of identifying and labeling classes of commonly used data that make it easier for humans or computers to locate or distribute such information on websites. –Dave Sanford Source: http://microformats.org/wiki/what-are-microformats HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 19. What are microformats? (cont’d) A microformat (sometimes abbreviated μF or uF) is a web-based data formatting approach that seeks to re-use existing content as metadata, using only XHTML and HTML classes and other attributes. This approach is intended to allow information intended for end-users (such as contact information, geographic coordinates, calendar events, and the like) to also be automatically processed by software. Source: http:// en.wikipedia.org/wiki/Microformats HTML validation, microformats, jQuery • WebTechNY / 8 October 2008
  • 20. Why use microformats? Aggregation sites The general model is the user travels to a particular site, and then proceeds to enter data (classified add, review, list of friends) for a particular purpose. Your information is scattered all over the Web, and you have to pick which sites you want to use. The combination of blogging and microformats is now reversing this model. Now, your information remains in your blog, and the Web sites come to you. For instance, if you want to sell something, you can blog about it using an hListing, and a site like edgeio will find it when it aggregates classified advertisements across the Web. Source: http://blog.mozilla.com/faaborg/2006/12/11/microformats-part-0-introduction/ Introduction to Microformats • WebTechNY / 8 October 2008
  • 21. Why use microformats? (cont’d) Sharing information with a specific community Let’s say you enjoy mountain biking, and would like to share various trails with other people who also enjoy mountain biking. If you posted this information to your blog, you could geocast (RSS with a payload of geo), the locations of the mountain bike trails, and other people in the community could subscribe to this feed using an application like Google Earth. Targeted search Let’s say you are creating a web comic, and you want other people to be able to find it. By posting your comic with a microformat agreed upon by the web comic community, the rest of the community will be able to easily find your work using a search engine. Source: http://blog.mozilla.com/faaborg/2006/12/11/microformats-part-0-introduction/ Introduction to Microformats • WebTechNY / 8 October 2008
  • 22. Why use microformats? (cont’d) CSS convenience Use semantic classes for styling instead of ad-hoc names: “Why invent your own class names when you can re-use pre-defined ones that give your site extra functionality for free?” Enhanced user experience (with the proper browser or plugins) Version 3 of the Firefox as well as version 8 of Internet Explorer are expected to include native support for microformats Ability to leverage markup for your own uses (we’ll see an example of this later) Introduction to Microformats • WebTechNY / 8 October 2008
  • 23. Who’s creating the microformats? Microformats emerged as part of a grassroots movement to make recognizable data items (such as events, contact details or geographical locations) capable of automated processing by software, as well as directly readable by end-users. As the microformats community grew, CommerceNet, a nonprofit organization that promotes electronic commerce on the Internet, helped sponsor and promote the technology and support the microformats community in various ways. CommerceNet also helped co-found the microformats community site microformats.org. Source: http:// en.wikipedia.org/wiki/Microformats Introduction to Microformats • WebTechNY / 8 October 2008
  • 24. Who’s creating the microformats? (cont’d) Neither CommerceNet nor Microformats.org is a standards body. The microformats community is an open wiki, mailing list, and Internet relay chat (IRC) channel. Most of the existing microformats were created at the Microformats.org wiki and associated mailing list, by a process of gathering examples of web publishing behaviour, then codifying it. Some other microformats (such as rel=nofollow and unAPI) have been proposed, or developed, elsewhere. Some names associated with microformats: Dan Cedarholm Tantek Çelik Drew McLellan Eric A. Meyer Source: http:// en.wikipedia.org/wiki/Microformats Introduction to Microformats • WebTechNY / 8 October 2008
  • 25. Where the specs are located and how to get involved Blog: http://microformats.org/ Wiki: http:// microformats.org/wiki/Main_Page Email list: http://microformats.org/discuss/ IRC: irc://irc.freenode.net#microformats Introduction to Microformats • WebTechNY / 8 October 2008
  • 27. Microformat specifications and drafts http://microformats.org/wiki/Main_Page#Specifications The ones I use: Specifications hCalendar hCard rel-license rel-nofollow rel-tag Drafts adr geo Introduction to Microformats • WebTechNY / 8 October 2008
  • 28. hCard hCard is a simple, open, distributed format for representing people, companies, organizations, and places, using a 1:1 representation of vCard (RFC2426) properties and values in semantic HTML or XHTML Spec: http://microformats.org/wiki/hcard Probably easiest way to learn the format is by example: http://microformats.org/code/hcard/creator The root class name for an hCard is &quot;vcard&quot;. An element with a class name of &quot;vcard&quot; is itself called an hCard . Introduction to Microformats • WebTechNY / 8 October 2008
  • 29. hCalendar hCalendar is a simple, open, distributed calendaring and events format, based on the iCalendar standard (RFC2445), suitable for embedding in HTML or XHTML, Atom, RSS, and arbitrary XML. Spec: http:// microformats.org/wiki/hcalendar Probably easiest way to learn the format is by example: http:// microformats.org/code/hcalendar/creator Note–the dtstart and dtend classes must be applied to abbr elements. DATE_FORMAT(startdate, '%Y-%m-%dT%H:%i:00') AS startdate Introduction to Microformats • WebTechNY / 8 October 2008
  • 30. Rel-License Rel-License is a simple, open, format for indicating content licenses which is embeddable in HTML or XHTML, Atom, RSS, and arbitrary XML Spec: http:// microformats.org/wiki/rel -license Rel-License is one of several MicroFormats. By adding rel=&quot;license&quot; to a hyperlink, a page indicates that the destination of that hyperlink is a license for the current page. E.g. with the following hyperlink: <a href=&quot;http://creativecommons.org/licenses/by/2.0/&quot; rel=&quot;license&quot;>cc by 2.0</a> the author indicates that the page is licensed under a Creative Commons 2.0 Attribution Required license. Multiple such rel=&quot;license&quot; hyperlinks indicate that the page is available under any of the referred licenses. E.g. the following hyperlinks could be used to declare that a page is available under either a Creative Commons 2.0 Attribution Required license or the Apache 2.0 license. Introduction to Microformats • WebTechNY / 8 October 2008
  • 31. Rel-License (cont’d) Creative Commons license chooser: http:// creativecommons.org /license/ Dreamweaver Extension suite ( http:// www.webstandards.org/action/dwtf/microformats / ) from the Web Standards Project ( http:// webstandards.org / ) enables the authoring of rel-license links from within Dreamweaver 8. Includes (cc) defaults. Introduction to Microformats • WebTechNY / 8 October 2008
  • 32. Rel-Tag Spec: http:// microformats.org/wiki/rel -tag By adding rel=&quot;tag&quot; to a hyperlink, a page indicates that the destination of that hyperlink is an author-designated &quot;tag&quot; (or keyword/subject) for the current page. Note that a tag may just refer to a major portion of the current page (i.e. a blog post). e.g. by placing this link on a page, <a href=&quot;http://technorati.com/tag/tech&quot; rel=&quot;tag&quot;>tech</a> the author indicates that the page (or some portion of the page) has the tag &quot;tech&quot;. The linked page SHOULD exist, and it is the linked page, rather than the link text, that defines the tag. The last path component of the URL is the text of the tag, so <a href=&quot;http://technorati.com/tag/tech&quot; rel=&quot;tag&quot;>fish</a> would indicate the tag &quot;tech&quot; rather than &quot;fish&quot;. Introduction to Microformats • WebTechNY / 8 October 2008
  • 34. Tools for reading microformats Firefox extensions: Operator A microformat detection extension developed by Michael Kaply at IBM. https://addons.mozilla.org/en-US/firefox/addon/4106 Tails The first microformat detection extension for Firefox by Robert de Bruin. http://blog.codeeg.com/tails-firefox-extension-03/ Source: http://labs.mozilla.com/2006/12/introducing-operator/ Introduction to Microformats • WebTechNY / 8 October 2008
  • 35. Tools for reading microformats (cont’d) Operator builds on Tails Export by having a user interface that is based around actions the user can take, instead of data types. Operator also includes support for the microformats geo and rel-tag, and is compatible with Firefox 3. Address book + Operator Blog post tag + Operator Maps + Operator Calendar + Operator Introduction to Microformats • WebTechNY / 8 October 2008
  • 36. Building your own applications on microformats Great tutorial on mapping microformats with jQuery at 24 ways: http://24ways.org/2007/unobtrusively-mapping-microformats-with-jquery Unobtrusive JavaScript jQuery Google Maps API Mapstraction http://24ways.org/examples/unobtrusively-mapping-microformats-with-jquery/restaurants-plain.html http://24ways.org/examples/unobtrusively-mapping-microformats-with-jquery/restaurants.html Introduction to Microformats • WebTechNY / 8 October 2008
  • 37. Some sites that use microformats Flickr Meetup.com Technorati Upcoming.org Yahoo! Local Introduction to Microformats • WebTechNY / 8 October 2008
  • 38. Microformat buttons http:// www.factorycity.net/projects/microformats -icons/ http:// microformats.org/wiki/buttons Introduction to Microformats • WebTechNY / 8 October 2008
  • 40. What is jQuery? jQuery is a JavaScript library. One among many: Protoype Dojo Toolkit MooTools jQuery is one of the newer JavaScript libraries. It was released in January 2006 by John Resig, author of Pro JavaScript Techniques. It’s a fast, lightweight library that emphasizes the interaction between HTML and JavaScript using CSS-style selectors. Has a great development community. Microsoft and Nokia intend to bundle jQuery on their platforms. HTML validation, microformats and jQuery • WebTechNY / 8 October 2008
  • 41. Why jQuery? JavaScript libraries make it faster and easier to develop distinctive JavaScript applications. No reason to roll your JS library from scratch or worry about handling cross-browser Ajax quirks. http:// en.wikipedia.org/wiki/Comparison_of_JavaScript_frameworks HTML validation, microformats and jQuery • WebTechNY / 8 October 2008
  • 42. DOM scripting without and with jQuery var external_links = document.getElementById('external_links'); var links = external_links.getElementsByTagName('a'); for (var i=0;i < links.length;i++) { var link = links.item(i); link.onclick = function() { return confirm('You are going to visit: ' + this.href); }; } $('#external_links a').click(function() { return confirm('You are going to visit: ' + this.href); }); HTML validation, microformats and jQuery • WebTechNY / 8 October 2008
  • 43. Another example: zebra-striping with jQuery $(‘table tr:nth-child(even)’).addClass(‘striped’); $() returns a JavaScript object containing an array of DOM elements that match the selector. ‘ table tr’ would return all table rows. :nth-child(n|odd|even) returns a specific child or all the even or odd children. .addClass adds the specified class or class name to the wrapped set. HTML validation, microformats and jQuery • WebTechNY / 8 October 2008
  • 44. Getting jQuery Two methods: Download jQuery from http://docs.jquery.com/Downloading_jQuery , upload to your web server and add a script element to the page. Use the Google Ajax Libraries API: http://code.google.com/apis/ajaxlibs/ Which is better? HTML validation, microformats and jQuery • WebTechNY / 8 October 2008
  • 45. Google Ajax Libraries API Caching is done correctly, and once, by Google. Developers don’t have to do anything. Gzipped Google serves minified versions The files are hosted by Google which has a distributed CDN at various points around the world, so the files are &quot;close&quot; to the user The servers are fast By using the same URLs, if a critical mass of applications use the Google infrastructure, when someone comes to your application the file may already be loaded. A subtle performance (and security) issue revolves around the headers that you send up and down. Since you are using a special domain (NOTE: not google.com!), no cookies or other verbose headers will be sent up, saving precious bytes. HTML validation, microformats and jQuery • WebTechNY / 8 October 2008
  • 46. Next steps Documentation and tutorials at the jQuery site: http://docs.jquery.com/Tutorials jQuery in Action. Bear Bibeault and Yehuda Katz. Manning. 2008. “ Simplify Ajax development with jQuery.” Jesse Skinner. http://www.ibm.com/developerworks/library/x-ajaxjquery.html 15 Days of jQuery: http://15daysofjquery.com/ Scott Trudeau’s (Apartment Therapy Media) “Introduction to Kicking Ass with jQuery”: http://webstandards.meetup.com/118/calendar/8689977/ HTML validation, microformats and jQuery • WebTechNY / 8 October 2008