One Click Validation

Jon Warbrick
University Computing Service, 2002-10-07

How to add a button (or buttons, or a menu of buttons if your browser supports it) to your browser toolbar that will submit the current document for consideration by a number of services, including HTML and CSS validation services, accessibility checkers, etc. With thanks to Google for the idea of JavaScript-submitting bookmarks, and John Line (jml4@cam.ac.uk) for ammendments and suggestions.

[UPDATED]2002-10-07: more services; correct escaping of URLs containing 'special' characters; results now open an a seperate window.

The basic idea is to create a bookmark to a JavaScript URL and then, probably, to add that to your bookmark toolbar to make it easy to get to:

  1. One way to do this is to create the bookmark 'by hand' by pasting in the JavaScript text shown below.
  2. Alternatively you can select one or more of the links below and then, if your browser lets you, drag them to your bookmark toolbar. Failing that, right click (hold down the only button on a Mac) on one of the links and chose "Add Bookmark for Link", "Add to favorites", or similar. Then use your browser's bookmark editing features to move the bookmark into your toolbar folder.
  3. The one thing you can't do is click on the link and then add it with 'Add Bookmark'. If you do, you'll create a link to the validation results for THIS page!
  4. If the bookmark has a silly name, like "javascript:blahblahblabh", then re-name it to something more useful.

This does all depend on your browser. I've had it working for Netscape 4.x under Unix and Windows, for IE 5.x under Windows and MacOS, and for Opera 5.0 and Mozilla 1.0 under Unix. It doesn't seem to work with Knoqueror.

W3C HTML Doctype Inline javascript:void(window.open('http://validator.w3.org/check?doctype=Inline&ss=&uri='+escape(location.href),%22_results%22))
W3C XHTML 1.0 Transitional javascript:void(window.open('http://validator.w3.org/check?doctype=XHTML%201.0%20Transitional&ss=&uri='+escape(location.href),%22_results%22))
W3C HTML 4.01 Transitional javascript:void(window.open('http://validator.w3.org/check?doctype=HTML%204.01%20Transitional&ss=&uri='+escape(location.href),%22_results%22))
W3C HTML 4.01 Strict javascript:void(window.open('http://validator.w3.org/check?doctype=HTML%204.01%20Strict&ss=&uri='+escape(location.href),%22_results%22))
W3C CSS javascript:void(window.open('http://jigsaw.w3.org/css-validator/validator?warnings=1&profile=css2&uri='+escape(location.href),%22_results%22))
W3C Link Check javascript:void(window.open('http://validator.w3.org/checklink?uri='+escape(location.href)+'&depth=&',%22_results%22))
WDG HTML javascript:void(window.open('http://www.htmlhelp.org/cgi-bin/validate.cgi?url='+escape(location.href)+'&warnings=yes&input=yes',%22_results%22))
Page Valet javascript:void(window.open('http://valet.webthing.com/page/v3.1?url='+escape(location.href)+'&wcag=0&fmt=HTML&xsl=wcag&parse=HTML',%22_results%22))
Page Valet + WCAG3 javascript:void(window.open('http://valet.webthing.com/page/v3.1?url='+escape(location.href)+'&wcag=3&fmt=HTML&xsl=wcag&parse=HTML',%22_results%22))
Link Valet javascript:void(window.open('http://valet.webthing.com/link/link.cgi?url='+escape(location.href)+'&type=Full&depth=0',%22_results%22))
Accessibility Valet WCAG1 javascript:void(window.open('http://valet.webthing.com/access/htnorm.so?url='+escape(location.href)+'&suite=WCAG1&xslt=listed',%22_results%22))
Accessibility Valet WCAG2 javascript:void(window.open('http://valet.webthing.com/access/htnorm.so?url='+escape(location.href)+'&suite=WCAG2&xslt=listed',%22_results%22))
Accessibility Valet WCAG3 javascript:void(window.open('http://valet.webthing.com/access/htnorm.so?url='+escape(location.href)+'&suite=WCAG3&xslt=listed',%22_results%22))
Cacheibility javascript:void(window.open('http://www.ircache.net/cgi-bin/cacheability.py?descend=descend&query='+escape(location.href),%22_results%22))
Bobby WCAG3 javascript:void(window.open('http://bobby.watchfire.com/bobby/bobbyServlet?URL='+escape(location.href)+'&output=Submit&gl=wcag1-aaa',%22_results%22))
Bobby S508 javascript:void(window.open('http://bobby.watchfire.com/bobby/bobbyServlet?URL='+escape(location.href)+'&output=Submit&gl=sec508',%22_results%22))
Linkscan javascript:void(window.open(%22http://www.cam.ac.uk:8181/LinkScan/live/quick.cgi?Now=1&Weblint=0&Url=%22+escape(location.href),%22_results%22))

Valid HTML 4.01!