code: function(url, params, formatFunction) {
  
  		if (params) {
  
  			// Set default formatting function
  			formatFunction = formatFunction || encodeURIComponent;
  
  			// Override the items in the URL which already exist
  			for (var x in params) {
  				var str = '([\\?\\&])' + x + '=[^\\&]*';
  				var reg = new RegExp(str);
  				if (url.match(reg)) {
  					url = url.replace(reg, '$1' + x + '=' + formatFunction(params[x]));
  					delete params[x];
  				}
  			}
  		}
  
  		if (!this.isEmpty(params)) {
  			return url + (url.indexOf('?') > -1 ? '&' : '?') + this.param(params, formatFunction);
  		}
  
  		return url;
  	}
docs: Append the querystring to a url @param string url @param object parameters