Skip to content

Instantly share code, notes, and snippets.

@jquerygeek
Created October 16, 2012 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jquerygeek/3902461 to your computer and use it in GitHub Desktop.
Save jquerygeek/3902461 to your computer and use it in GitHub Desktop.
init: function() {
var html = "<!doctype html><html lang='en'>" + $('html').html() + "</html>";
var validatorURL = "http://html5.validator.nu/?out=json";
$.post({url: validatorURL, headers: {"Content-type": "text/html"}, body: html},
function(err, res, body) {
alert('response: '+res);
if (err) alert(err);
var data = JSON.parse(body);
console.log(data);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment