I’ve seen various articles and posts on how to use PHP tp grab the search term used to find a site. For example,
Capture search engine keywords in php
How can I also do this with Javascript / jQuery?
Ultimately, I want to grab the keywords and use them for an AJAX request that I already have written and working (for something else similar but different).
Note: This is a new area for me so type slow, spoon feed it, and if ya can, links to more details are always appreciated.
You can use
document.referrerto get the url of the previous page url like so:would output something like:
to just feed to your ajax.