I need to report search terms that are part of the URL string. The URL "http://about.jstor.org/search/node/jstor" contains the search term, "jstor", at the end of the URL.
When test "window.location.href.substring(35);" in the developer console, it returns the search term value. When I add s.eVar61 to the string "s.eVar61 = window.location.href.substring(35);" and test it in the console, I get and Uncaught Reference Error. How do I fix it so that I can I parse out and report the search term in the URL string?
Thank you,
Bill
Solved! Go to Solution.
if the protocol is absent or different, or if the URL is any longer or shorter, that's going to give you some issues there.
You could try instead using the following:
s.eVar61=window.location.href.split('/search/node/')[1];
if the protocol is absent or different, or if the URL is any longer or shorter, that's going to give you some issues there.
You could try instead using the following:
s.eVar61=window.location.href.split('/search/node/')[1];
I will give it a try.
Thank you
Views
Replies
Total Likes