This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |