unobtrusive javascript
TRANSCRIPT
![Page 1: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/1.jpg)
UnobtrusiveJavaScript
![Page 2: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/2.jpg)
DaveVerwerhttp://daveverwer.com
http://shinydevelopment.com
![Page 3: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/3.jpg)
WhatisUJS?
![Page 4: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/4.jpg)
Didithavefullfunctionality? No
Wasitasquick? No
Wasitaspretty? No
Wasitasusable? No
Diditbasicallywork? Yes
![Page 5: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/5.jpg)
Whyshouldyoucare?
![Page 6: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/6.jpg)
Accessibility
![Page 7: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/7.jpg)
MobileBrowsing
![Page 8: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/8.jpg)
SEO
![Page 9: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/9.jpg)
ValidHTML4.01orXHTML1.0CSSandsemanticHTMLandseparationofstructureandpresentationProgressiveenhancementTheW3CDOM(insteadoftheoldMicrosoftdocument.all)MeaningfulvaluesofclassandidMeaningfulaltattributesonallimagesScriptsthatworkonlinksshouldextendthebasiclinkfunctionality(thinkaccessiblepopups)Ifalinkmakesnosensewithoutascript,itshouldn'tbeintheHTML(butbegeneratedbyJavaScript)UseofformsorscriptsastheonlymeansofgettingcertaininformationisprohibitedRemovingthefocusrectangleonlinksisprohibitedInformationofferedinaclosedformat(thinkWord)shouldalsobeofferedinanopenformatThesemanticsofmanyHTMLelementsareexplicitlydefined
Asof1stSeptember2005,everywebsitebuiltforadutchgovernment
agencyisrequiredbylawtoconformto:
![Page 10: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/10.jpg)
Point3:
ProgressiveEnhancement.
![Page 11: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/11.jpg)
Point7:
Scriptsthatworkonlinksshouldextendthebasiclinkfunctionality.
![Page 12: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/12.jpg)
Point8:
Ifanelementmakesnosensewithoutascript,itshouldn'tbeintheHTML.
![Page 13: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/13.jpg)
Point9:
Useofformsorscriptsastheonlymeansofgettingcertaininformationisprohibited.
![Page 14: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/14.jpg)
SoJavaScriptisevil,right?
![Page 15: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/15.jpg)
GoodJavaScript
![Page 16: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/16.jpg)
![Page 17: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/17.jpg)
![Page 18: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/18.jpg)
BadJavaScript
![Page 19: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/19.jpg)
![Page 20: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/20.jpg)
TheDarkAgesoftheWeb
![Page 21: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/21.jpg)
![Page 22: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/22.jpg)
![Page 23: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/23.jpg)
Seperatingcontentfromdesign
![Page 24: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/24.jpg)
<b><font size="5"><font color="#0000FF">THIS SITE IS UNDER CONSTRUCTION!!</font></font></b>
<style> p.construction { color: #00f; font-size: 1.5em; font-weight: bold; }</style>
<p class="construction"> THIS SITE IS UNDER CONSTRUCTION!!</p>
![Page 25: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/25.jpg)
Seperatingcontentfromdesign
andbehaviour
![Page 26: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/26.jpg)
target=“_blank”demo
![Page 27: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/27.jpg)
Prototype&LowPro
![Page 28: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/28.jpg)
<a class=“external”>
![Page 29: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/29.jpg)
Event.addBehavior({ "a.external:click": function(event) { window.open(this.href, "ext"); return false; }});
![Page 30: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/30.jpg)
Settingaclassbecomesanindicatorofbehaviour
notjuststyle
![Page 31: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/31.jpg)
Makesurenothingbreaks
![Page 32: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/32.jpg)
StartminimalandshowUIor
StartbigandhideUI
![Page 33: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/33.jpg)
JSSpecificUIdemo
![Page 34: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/34.jpg)
UJSpluginforRailsdemo
![Page 35: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/35.jpg)
Summary
![Page 36: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/36.jpg)
Doesitreallyneedit?
![Page 37: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/37.jpg)
Dolinksstillwork?
![Page 38: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/38.jpg)
Doesthisbreakthebackbutton?
![Page 39: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/39.jpg)
Don’trelyonalert()forconfirmations
![Page 40: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/40.jpg)
Scriptshiddenawaywhenpossible?
![Page 41: Unobtrusive Javascript](https://reader038.vdocuments.site/reader038/viewer/2022102711/555607cad8b42a3f168b4acd/html5/thumbnails/41.jpg)
EnhancingAccessibilitywithJavaScript?!?