Permalink
Browse files

check in latest updates

  • Loading branch information...
1 parent 79ec610 commit 6041b4f296bb8c8958bb1b990253bad321c2545e @mythz mythz committed Jan 27, 2012
Showing with 10 additions and 9 deletions.
  1. +1 −1 dist/jquip.ajax.min.js
  2. +8 −7 dist/jquip.all.js
  3. +1 −1 dist/jquip.all.min.js
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1086,7 +1086,7 @@ window['$'] = window['jquip'] = (function(){
var xhr = _xhr(), timer, n = 0;
if (typeof url === "object") o = url;
else o['url'] = url;
- o = $['_defaults'](o, { 'userAgent': "XMLHttpRequest", 'lang': "en", 'type': "GET", 'data': null, 'contentType': "application/x-www-form-urlencoded", 'dataType': "application/json" });
+ o = $['_defaults'](o, { 'userAgent': "XMLHttpRequest", 'lang': "en", 'type': "GET", 'data': null, 'contentType': "application/x-www-form-urlencoded", 'dataType': null, 'processData': true });
if (o.timeout) timer = setTimeout(function () { xhr.abort(); if (o.timeoutFn) o.timeoutFn(o.url); }, o.timeout);
var cbCtx = $(o['context'] || document), evtCtx = cbCtx;
xhr.onreadystatechange = function() {
@@ -1111,14 +1111,15 @@ window['$'] = window['jquip'] = (function(){
};
var url = o['url'], data = null;
var isPost = o['type'] == "POST" || o['type'] == "PUT";
- if (!isPost && o['data']) url += "?" + formData(o['data']);
+ if( o['data'] && o['processData'] && typeof o['data'] == 'object' )
+ data = $['formData'](o['data']);
+
+ if (!isPost && data) url += "?" + data;
xhr.open(o['type'], url);
- if (isPost) {
- var isJson = o['dataType'].indexOf("json") >= 0;
- data = isJson ? window.JSON.stringify(o['data']) : formData(o['data']);
- xhr.setRequestHeader("Content-Type", isJson ? "application/json" : "application/x-www-form-urlencoded");
- }
+ if (isPost)
+ xhr.setRequestHeader("Content-Type", o['contentType']);
+
xhr.send(data);
} $['ajax'] = ajax;
$['getJSON'] = function (url, data, success, error) {
Oops, something went wrong.

0 comments on commit 6041b4f

Please sign in to comment.