code: function appendQueryParameters(url, parameters){
      
      var hash = "", indexOf = url.indexOf("#");
      if (indexOf !== -1) {
          hash = url.substring(indexOf);
          url = url.substring(0, indexOf);
      }
      var q = [];
      for (var key in parameters) {
          if (parameters.hasOwnProperty(key)) {
              q.push(key + "=" + encodeURIComponent(parameters[key]));
          }
      }
      return url + (useHash ? "#" : (url.indexOf("?") == -1 ? "?" : "&")) + q.join("&") + hash;
  }
docs: Appends the parameters to the given url.<br/>
  The base url can contain existing query parameters.
  @param {String} url The base url.
  @param {Object} parameters The parameters to add.
  @return {String} A new valid url with the parameters appended.