I'm using Javascript to grab a variable passed through the URL:
function get_url_parameter( param ){
param = param.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var r1 = "[\\?&]"+param+"=([^&#]*)";
var r2 = new RegExp( r1 );
var r3 = r2.exec( window.location.href );
if( r3 == null )
return "";
else
return r3[1];
}
Once I have the parameter required
var highlightsearch = get_url_parameter('search');
I want to be able to delete all of the string after the ">".
e.g
The result currently looks like this:
highlightsearch = "Approved%20XXXXX%20XXXXX>YYYY%20YYYYYYY%20YYYY%20-%20YYYY%20YYYY";
After my string manipulation I want it to hopefully look like
highlightsearch = "Approved%20XXXXX%20XXXXX";
Any help would be great.