1

There are 1 best solutions below

2
On

You can access the query string as follows:

var queryString = location.search.substr( 1 );

From there on, it's easier to split it at the delimiters and create an object out of it:

var queryObject = {};

queryString.split( '&' ).forEach( function objectFromPair( pairString ){
    var pairArray = pairString.split( '=' );

    queryObject[ pairArray[ 0 ] ] = pairArray[ 1 ];
} );

Next, retrieve the parent key:

var parentUrl = queryObject.parent;