If the form has a default value, such as "or" Search here .. ", you can check if the default value has changed, and then submit the form:
// If the input value is different from the know default if($("#search_form_input").val() != "Search here..") { // Update the results on the page $('#search_form_submit_button').click(); }
And call it ready on the page - so inside $(function(){ /* content here */ });
Also, look at History.js - https://github.com/browserstate/History.js
It provides a truly complete history management system. It supports jQuery among several other libraries.
EDIT:
I will talk about some of the things that Renault mentioned in his comment.
You can use this small library of Session Variables to save page change data. Download the js file from this link and include it in the <head> your document:
<script type="text/javascript" src="sessionvars.js"></script>
Then, when the user performs a search, save the search in the sessvars object, which is now available on all pages:
sessvars.myObj = { searched: $("#Search_form_input").val() }
Then, when the page loads, check to see if sessvars.myObj.search matters. If this happens, search for this value:
if(sesvars && sessvars.myObj && sessvars.myObj.searched) { $("#Search_form_input").val(sessvars.myObj.searched); $('#search_form_submit_button').click(); }
source share