code: function(p) {
  
  			var _this = this;
  			var w = window;
  			var data = p.data;
  
  			// Is data a form object
  			if (_this.domInstance('form', data)) {
  				data = _this.nodeListToJSON(data.elements);
  			}
  			else if ('NodeList' in w && data instanceof NodeList) {
  				data = _this.nodeListToJSON(data);
  			}
  			else if (_this.domInstance('input', data)) {
  				data = _this.nodeListToJSON([data]);
  			}
  
  			// Is data a blob, File, FileList?
  			if (('File' in w && data instanceof w.File) ||
  				('Blob' in w && data instanceof w.Blob) ||
  				('FileList' in w && data instanceof w.FileList)) {
  				data = {file: data};
  			}
  
  			// Loop through data if it's not form data it must now be a JSON object
  			if (!('FormData' in w && data instanceof w.FormData)) {
  
  				for (var x in data) if (data.hasOwnProperty(x)) {
  
  					if ('FileList' in w && data[x] instanceof w.FileList) {
  						if (data[x].length === 1) {
  							data[x] = data[x][0];
  						}
  					}
  					else if (_this.domInstance('input', data[x]) && data[x].type === 'file') {
  						continue;
  					}
  					else if (_this.domInstance('input', data[x]) ||
  						_this.domInstance('select', data[x]) ||
  						_this.domInstance('textArea', data[x])) {
  						data[x] = data[x].value;
  					}
  					else if (_this.domInstance(null, data[x])) {
  						data[x] = data[x].innerHTML || data[x].innerText;
  					}
  				}
  			}
  
  			p.data = data;
  			return data;
  		}
docs: DataToJSON This takes a FormElement|NodeList|InputElement|MixedObjects and convers the data object to JSON.