This file contains hidden or 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
var submitForm = function(config) { | |
if (!config) { | |
throw new Error(); | |
} | |
else { | |
config.method = config.method || 'post'; | |
config.data = config.data || {}; | |
config.url = config.url || (function() { | |
throw new Error('Missing required `url` argument'); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Proof of Concept</title> | |
<script> | |
// TODO how should Arrays be handled? | |
// TODO strict mode (no '\n' or padding) to allow for significant whitespace (e.g. for <pre>, <textarea>) | |
var toHTML = function(value, name, indent) { | |
var pad = new Array((indent = indent || 0)).join(' '); | |
This file contains hidden or 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
<!DOCTYPE html> | |
<html xmlns:pretty="http://prettycode.org/xmlns/json2xml"> | |
<head> | |
<title>Proof of Concept</title> | |
<script> | |
var XML = { | |
defaultNamespace: undefined, | |
stringify: function(ns, value, name) { | |
if (typeof ns === 'undefined') { | |
ns = this.defaultNamespace; |
This file contains hidden or 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
// Working example: http://www.jsfiddle.net/mUrVB/22/ | |
(function($) { | |
$.fn.selection = function() { | |
var start = this[0].selectionStart, | |
end = this[0].selectionEnd; | |
if (start === end) { | |
return null; |
NewerOlder