(function(W) {
	'use strict';

	W.fn.make('data', {
		// Make Ajax request based on specified options
		request: function(opt) {
			var conf = W.$extend({
					args: [],
					data: {}
				}, opt);

			if (conf.cache === false) {
				conf.data.dt = new Date().getTime();
			}

			if (conf.jsonp) {
				var head = W._doc.getElementsByTagName('head')[0];

				if (conf.success) {
					var v = this.$get('v', 1),
						func = 'jsonp' + v;

					W._win[func] = function(data) {
						conf.args.unshift(data);

						W.$exec(conf.success, {
							args: conf.args,
							scope: conf.scope
						});
					};

					conf.data[conf.jsonp === true ? 'callback' : conf.jsonp] = func;

					this.$set('v', v + 1);
				}

				if (Object.keys(conf.data).length > 0) {
					conf.url += '?' + W.$serialize(conf.data);
				}

				var el = W._doc.createElement('script');

				el.src = conf.url;

				if (conf.failure) {
					el.onerror = function() {
						W.$exec(conf.failure, {
							args: conf.args,
							scope: conf.scope
						});
					};
				}

				head.appendChild(el);
			} else {
				var x = new XMLHttpRequest();

				x.onreadystatechange = function() {
					if (x.readyState === 4) {
						if (x.status >= 200 && x.status < 400) {
							if (conf.success) {
								var resp = x.responseText,
									orig = resp;

								// Parse JSON response if specified
								if (conf.json || conf.template) {
									try {
										resp = JSON.parse(resp);
									} catch (e) {
										resp = {};
									}

									if (conf.template) {
										resp = W.view.render(conf.template, resp);
										conf.args.unshift(orig);
									}
								}

								conf.args.unshift(resp, x);

								// Execute success callback if specified
								W.$exec(conf.success, {
									args: conf.args,
									scope: conf.scope
								});

								return true;
							}
						} else {
							if (conf.failure) {
								conf.args.unshift(x);

								W.$exec(conf.failure, {
									args: conf.args,
									scope: conf.scope
								});
							}

							return false;
						}
					}
				};

				var send = null;

				// Post or get endpoint based on specification
				if (conf.method == 'post') {
					x.open('POST', conf.url, true);
					x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
					send = W.$isObject(conf.data) ? W.$serialize(conf.data) : conf.data;
				} else {
					if (Object.keys(conf.data).length > 0) {
						conf.url += '?' + W.$serialize(conf.data);
					}

					x.open('GET', conf.url, true);
				}

				// Set request headers
				if (conf.headers) {
					var keys = Object.keys(conf.headers),
						i = 0;

					for (; i < keys.length; i++) {
						var key = keys[i];
						x.setRequestHeader(key, conf.headers[key]);
					}
				}

				// Send request
				x.send(send);
			}
		},
		// Render specified data into specified template string
		// Return string
		// DEPRECATED
		parse: function(temp, data) {
			return W.view.render(temp, data);
		}
	});
})(Wee);
@@ -173,16 +173,34 @@
 %09%09%09data:
+ %7B%7D,%0A%09%09%09%09%09headers:
  %7B%7D%0A%09%09%09%09
@@ -2575,146 +2575,343 @@
 %09// 
-Set request headers%0A%09%09%09%09if (conf.headers) %7B%0A%09%09%09%09%09var keys = Object.keys(conf.headers),%0A%09%09%09%09%09%09i = 0;%0A%0A%09%09%09%09%09for (; i %3C keys.length; i++
+Add X-Requested-With header for same domain requests%0A%09%09%09%09var a = W._doc.createElement('a'),%0A%09%09%09%09%09xrw = 'X-Requested-With';%0A%09%09%09%09a.href = conf.url;%0A%0A%09%09%09%09if (a.hostname == Wee._win.location.hostname && ! conf.headers%5Bxrw%5D) %7B%0A%09%09%09%09%09conf.headers%5Bxrw%5D = 'XMLHttpRequest';%0A%09%09%09%09%7D%0A%0A%09%09%09%09// Set request headers%0A%09%09%09%09for (var key in conf.headers
 ) %7B%0A
-%09
 %09%09%09%09
@@ -2919,22 +2919,59 @@
 var 
-key = keys%5Bi%5D;
+val = conf.headers%5Bkey%5D;%0A%0A%09%09%09%09%09if (val !== false) %7B
 %0A%09%09%09
@@ -2997,33 +2997,19 @@
 er(key, 
-conf.headers%5Bkey%5D
+val
 );%0A%09%09%09%09%09

Add X-Requested-With ajax header by default for internal requests