I am trying to set a variable. The variable should be parts of a Search query in the URL. I’m assuming to use REGEX to achieve this.
IE URL: http://tsqja.deznp.servertrust.com/SearchResults.asp?Search=true+ glass&x=0&y=0
I want to pull the words ‘true’ and ‘glass’ in the example above and throw them in a jQuery variable.
ie. var newKeys = $(search keys = some code);
I am no good at using REGEX but would this just be my variable?
/^http:\/\/(tsqja\.)?deznp\.servertrust\./i,/Search=([^&]+)/i
is this for a url alone or for the current url of the page the javascript is on? if the latter, it’s as simple as
otherwise you could do
EDIT
So something like this might work (per your comments)