Skip to content

Instantly share code, notes, and snippets.

View xjamundx's full-sized avatar

Jamund Ferguson xjamundx

View GitHub Profile
@xjamundx
xjamundx / views
Last active December 14, 2015 05:09 — forked from jquerygeek/views
define(function(require) {
var Backbone = require('backbone')
var template = require('text!../../template/newThread.html')
return Backbone.View.extend({
el: '#container',
template: _.template(template),
initialize: function () {
this.render()
var Contact = require('model/contact')
@xjamundx
xjamundx / validator.js
Created October 16, 2012 22:43 — forked from jquerygeek/validator
validator.nu client-side
// easy way to get current pages HTML
$.get('#', function(html) {
// emulate form post
var formData = new FormData();
formData.append('out', 'json');
formData.append('content', html);
// make ajax call
$.ajax({
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);
});