diff --git a/dom.js b/dom.js index 4c2530d..ca825f5 100644 --- a/dom.js +++ b/dom.js @@ -42,6 +42,7 @@ jx.dom.remove = function(id){ _item = id ; } _item.parentNode.removeChild(_item) ; + return _item ; } diff --git a/ext/ml.js b/ext/ml.js index 7e96221..6fd4902 100644 --- a/ext/ml.js +++ b/ext/ml.js @@ -58,4 +58,3 @@ jx.ml.mapreduce = function(data,fn_map,fn_reduce){ * The modules developed below will perform linear regression and logistic regression */ jx.ml.regression = {} - diff --git a/rpc.js b/rpc.js index 8b7bb68..c66d303 100755 --- a/rpc.js +++ b/rpc.js @@ -112,6 +112,15 @@ jx.ajax.get.instance = function(){ } + this.put = function(url,callback){ + this.send(url,callback,'PUT') ; + } + this.get = function(url,callback){ + this.send(url,callback,'GET') ; + } + this.post = function(url,callback){ + this.send(url,callback,'POST') ; + } }//-- end of the factory method return new factory() ; } @@ -119,3 +128,4 @@ jx.ajax.get.instance = function(){ // // backward compatibility jx.ajax.getInstance = jx.ajax.get.instance ; +HttpClient = jx.ajax.get ; diff --git a/utils.js b/utils.js index d92ea73..bc10207 100644 --- a/utils.js +++ b/utils.js @@ -89,6 +89,20 @@ jx.utils.unique = function (list,getKey){ }) } } +jx.utils.join = function(x,y){ + if(x.length != y.length){ + return [] + }else{ + var rec = x ; + for(var i in rec){ + // + //@TODO: Consider the case we are adding to a matrix + // + rec[i] = [x[i],y[i]] + } + return rec ; + } +} /** * Implementation of a few standard design patterns. Their use is user/dependent * For more information on how/when to use a design pattern please use google/wikipedia ;-) @@ -169,3 +183,4 @@ jx.utils.patterns.observer = function(lobservers,init){ * @return array containing casted type */ jx.utils.cast = jx.utils.patterns.visitor ; +