pzHttpRequest.prototype =
{
+
get: function ( params, callback )
{
this._send( 'GET', params, '', callback );
return this.request.responseXML;
},
+ encodeParams: function (params)
+ {
+ var sep = "";
+ var encoded = "";
+ for (var key in params) {
+ if (params[key] != null) {
+ encoded += sep + key + '=' + encodeURIComponent(params[key]);
+ sep = '&';
+ }
+ }
+ return encoded;
+ },
+
_send: function ( type, params, data, callback )
{
this.callback = callback;
_urlAppendParams: function (params)
{
- var getUrl = this.url;
-
- var sep = '?';
- var el = params;
- for (var key in el) {
- if (el[key] != null) {
- getUrl += sep + key + '=' + encodeURIComponent(el[key]);
- sep = '&';
- }
- }
- return getUrl;
+ return this.url + "?" + this.encodeParams(params);
},
_handleResponse: function ()