-5

How do I get the following query in javascript? It's important that we target search_query specifically.

search.php?search_query=flowers

None of the answers tell you how to specifically get the search query.

UPDATE: the answer can be found here - http://kcwebprogrammers.blogspot.com/2010/07/javascript-to-get-parameter-from-url.html

Gast1
  • 199
  • 1
  • 3
  • 9

1 Answers1

1

window.location.search will give you the entire search string including the ?. Can you take it from there?

HBP
  • 15,685
  • 6
  • 28
  • 34