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 submit of search string (to google) ?

or

  • what best way capture returning results (back google) can assume search term has 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

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -