javascript - Google CSE "Search Term(s)" to be saved in own way? -
since i'm using google cse, main idea show "top search terms" under cse search box. in cse panel, google saying:
no queries sufficiently popular listed
so anyway (i don't want wait sufficient enough and) .. want implement on own.
- what best way capture
submitof search string (to google) ?
or
- what best way capture
returning results(back google) can assumesearch termhas been used. can mark/save current search term.
.
as reference, i've done far:
<!-- goolge cse --> <script language="javascript"> (function() { var cx = 'xxxx3941849086xxxxx:xxxxmtk5xxxxxx'; var gcse = document.createelement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx; var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(gcse, s); })(); </script> <body> <!-- gcse search box --> <div class="global-search"> <gcse:searchbox-only linktarget="http://www.example.com/search" queryparametername="query"></gcse:searchbox-only> </div> <!-- gcse result div --> <div id="googlecse-result"> <gcse:search linktarget="_parent" queryparametername="query"></gcse:search> </div> </body>
i find value of search term here , save in own db:
google.search.cse.element.getelement('standard0').getinputquery() i wouldn't advise hardcoding 'standard0'.
if give gcse elements name using gname="somename" can use reference.
google.search.cse.element.getelement('somename').getinputquery()
Comments
Post a Comment