README.txt
[gitlive] / XMLHttpRequest.js
index b9fbbae..381b759 100644 (file)
@@ -88,9 +88,9 @@ XMLHttpRequest.prototype = {
     {
         data = data|| false;
         
-        if (typeof(date) == 'object') {
+        if (typeof(data) == 'object') {
             // params..
-            
+            data = this.urlEncode(data);
         }
         
         if (data) {
@@ -147,23 +147,23 @@ XMLHttpRequest.prototype = {
     getAllResponseHeaders : function ()
     {
         
-    }
+    },
     urlEncode : function(o){
         if(!o){
             return "";
         }
         var buf = [];
         for(var key in o){
-            var ov = o[key], k = Roo.encodeURIComponent(key);
+            var ov = o[key], k = encodeURIComponent(key);
             var type = typeof ov;
             if(type == 'undefined'){
                 buf.push(k, "=&");
             }else if(type != "function" && type != "object"){
-                buf.push(k, "=", Roo.encodeURIComponent(ov), "&");
+                buf.push(k, "=", encodeURIComponent(ov), "&");
             }else if(ov instanceof Array){
                 if (ov.length) {
                     for(var i = 0, len = ov.length; i < len; i++) {
-                        buf.push(k, "=", Roo.encodeURIComponent(ov[i] === undefined ? '' : ov[i]), "&");
+                        buf.push(k, "=", encodeURIComponent(ov[i] === undefined ? '' : ov[i]), "&");
                     }
                 } else {
                     buf.push(k, "=&");