1 jls.loader.provide('jls.util.Sxe'); 2 3 jls.util.Sxe = jls.lang.Class.create({ 4 initialize : function(url) { 5 this._url = url; 6 }, 7 sendRecv : function(value, callback) { 8 new _native.boot.httpRequest(this._url, { 9 method :'post', 10 contentType :'text/plain', 11 postBody :value, 12 asynchronous :true, 13 onException : function(e) { 14 callback(null, e); 15 }, 16 onFailure : function() { 17 callback(null, 'Fail to get text from ' + url); 18 }, 19 onSuccess : function() { 20 callback(new XML(this.getXHR().responseText), null); 21 } 22 }).send(); 23 } 24 }); 25