makeUrl = function makeUrl(s) {
  var search = window.location.search;
  return (search ? search + '&' : '?' ) + 'grep=' + encodeURIComponent(s);
}
Makes a URL, preserving querystring ("search") parameters.
@param {string} s
@returns {string} your new URL