docs: function jq_param_sub( is_fragment, get_func, url, params, merge_mode ) {
      var result,
        qs,
        matches,
        url_params,
        hash;
      
      if ( params !== undefined ) {
        // Build URL by merging params into url string.
        
        // matches[1] = url part that precedes params, not including trailing ?/#
        // matches[2] = params, not including leading ?/#
        // matches[3] = if in 'querystring' mode, hash including leading #, otherwise ''
        matches = url.match( is_fragment ? /^([^#]*)\#?(.*)$/ : /^([^#?]*)\??([^#]*)(#?.*)/ );
        
        // Get the hash if in 'querystring' mode, and it exists.
        hash = matches[3] || '';
        
        if ( merge_mode === 2 && is_string( params ) ) {
          // If merge_mode is 2 and params is a string, merge the fragment / query
          // string into the URL wholesale, without converting it into an object.
          qs = params.replace( is_fragment ? re_trim_fragment : re_trim_querystring, '' );
          
        } else {
          // Convert relevant params in url to object.
          url_params = jq_deparam( matches[2] );
          
          params = is_string( params )
            
            // Convert passed params string into object.
            ? jq_deparam[ is_fragment ? str_fragment : str_querystring ]( params )
            
            // Passed params object.
            : params;
          
          qs = merge_mode === 2 ? params                              // passed params replace url params
            : merge_mode === 1  ? $.extend( {}, params, url_params )  // url params override passed params
            : $.extend( {}, url_params, params );                     // passed params override url params
          
          // Convert params object to a string.
          qs = jq_param( qs );
          
          // Unescape characters specified via $.param.noEscape. Since only hash-
          // history users have requested this feature, it's only enabled for
          // fragment-related params strings.
          if ( is_fragment ) {
            qs = qs.replace( re_no_escape, decode );
          }
        }
        
        // Build URL from the base url, querystring and hash. In 'querystring'
        // mode, ? is only added if a query string exists. In 'fragment' mode, #
        // is always added.
        result = matches[1] + ( is_fragment ? '#' : qs || !matches[1] ? '?' : '' ) + qs + hash;
        
      } else {
        // If URL was passed in, parse params from URL string, otherwise parse
        // params from window.location.
        result = get_func( url !== undefined ? url : window[ str_location ][ str_href ] );
      }
      
      return result;
    }