PHP dev needing JS help! I'm pretty new to JS and can't figure this out.
I have a small jQuery plugin gSearch http://gsearch.scottreeddesign.com/index.html That performs a Google Search within your page. It isnt built with POST/GET capabilities, you need to define the 'search term' within the functions parameters. I am trying to modify it.
I have 2 pages:
search.html contains:
<form action="results.html">
<input type="text" name="q" id="term">
<input type="button" id="search_button" onclick="this.form.submit();">
</form>
results.html contains:
$("#search-results").gSearch({
search_text : 'brian griffin',
count : 4,
site : 'wikipedia.org',
pagination : false
});
and in the body:
<div id="search-results"></div>
Now I need to get the search term from the form and pass it as a variable to the .gSearch function. How would I go about this? I see posts on how to get/return url parameter but I can't seem to find any explaining how to turn it into a variable and pass it to another function? I can do this with my eyes closed with pure PHP but I'm new to JS!