My url will have querystring like the following
TestPage.aspx?s=bcs_locations&k=userkwd* bcslocationtype:"Hospital"
where ?s=bcs_locations will always be the same. there are three checkboxes and an inputbox for user input. If user only checks checkboxes, the url will look like this:
TestPage.aspx?s=bcs_locations&k=bcslocationtype:"Hospital"
If user only types in sth in inputbox, url will be like this:
TestPage.aspx?s=bcs_locations&k=vincent*
if user checks some checkbox and also types in keyword in the inputbox, URL will look like
TestPage.aspx?s=bcs_locations&k=userkwd* bcslocationtype:"Hospital"
'Hospital' etc is the value of selected checkbox.
Now I only need to grab anything infront of * and k=, if ever * exists in the URL?
I can get the querystring like this:
var val=window.location.href.match(/[?&]k=([^&#]+)/) || [];
if (value.length == 2) {
valuesafterK=value[1];
//i now need values after k= and * if there * in value[1]
}