If this is just one key=valuein the url, you can use a simple regex:
var theValueYouWant = window.location.href.match(/keyword=(.+)/)[1]
And set the input value like this
$('input').val(theValueYouWant)
If you want to parse the GET string more carefully, this function should do it ...
gets = {};
$.each(location.search.replace(/^\?/,'').split('&'),function(k,v){
bits = v.split('=');
gets[bits[0]] = bits[1];
});
source
share