bp_includes/static/js/script.js
/**
 *  Author:  @coto
 *  Function: insertParamToURL
 *  @param {String} key Parameter to insert into URL
 *  @param {String} value Value for new parameter
 *
 *  Insert parameters to the URL recognizing if it had parameters before.
 *  It will reload the page, it's likely better to store this until finished
 */
@coto
Function: insertParamToURL
@param {String} key Parameter to insert into URL
@param {String} value Value for new parameter

Insert parameters to the URL recognizing if it had parameters before.
It will reload the page, it's likely better to store this until finished
@coto Function : insertParamToURL @param { String } key Parameter to insert into URL @param { String } value Value for new parameter Insert parameters to the URL recognizing if it had parameters before . It will reload the page it ' s likely better to store this until finished
function insertParamToURL(key, value)
{
    key = escape(key); value = escape(value);
    var kvp = document.location.search.substr(1).split('&');
    var i=kvp.length; var x;
    while(i--) {
        x = kvp[i].split('=');
        if (x[0]==key)
        {
            x[1] = value;
            kvp[i] = x.join('=');
            break;
        }
    }
    if(i<0) {kvp[kvp.length] = [key,value].join('=');}
    document.location.search = kvp.join('&');
}
function insertParamToURL ( key , value ) { key = escape ( key ) ; value = escape ( value ) ; var kvp = document . location . search . substr ( 1 ) . split ( '&' ) ; var i = kvp . length ; var x ; while ( i -- ) { x = kvp [ i ] . split ( '=' ) ; if ( x [ 0 ] == key ) { x [ 1 ] = value ; kvp [ i ] = x . join ( '=' ) ; break ; } } if ( i < 0 ) { kvp [ kvp . length ] = [ key , value ] . join ( '=' ) ; } document . location . search = kvp . join ( '&' ) ; }
Author:  @coto
  Function: insertParamToURL
  @param {String} key Parameter to insert into URL
  @param {String} value Value for new parameter
Author : @coto Function : insertParamToURL @param { String } key Parameter to insert into URL @param { String } value Value for new parameter