capri:search
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| capri:search [2011/04/12 11:49] – external edit 127.0.0.1 | capri:search [2022/11/07 10:23] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| - | <div id="cse" style=" | + | |
| - | < | + | <div id="test"></ |
| - | <script type=" | + | |
| - | google.load(' | + | <script> |
| - | | + | var myCallback |
| - | var customSearchControl | + | if (document.readyState == ' |
| - | | + | |
| - | | + | // Render an element with both search box and search results in div with id ' |
| - | }, true); | + | |
| + | { | ||
| + | div: "test", | ||
| + | tag: ' | ||
| + | }); | ||
| + | } else { | ||
| + | | ||
| + | | ||
| + | // Render an element with both search box and search results in div with id ' | ||
| + | google.search.cse.element.render( | ||
| + | { | ||
| + | div: " | ||
| + | tag: ' | ||
| + | }); | ||
| + | }, true); | ||
| + | } | ||
| + | }; | ||
| + | |||
| + | // Insert it before the CSE code snippet so that cse.js can take the script | ||
| + | // parameters, like parsetags, callbacks. | ||
| + | window.__gcse = { | ||
| + | parsetags: 'explicit', | ||
| + | callback: myCallback | ||
| + | }; | ||
| + | |||
| + | (function() { | ||
| + | var cx = ' | ||
| + | var gcse = document.createElement(' | ||
| + | gcse.async = true; | ||
| + | gcse.src = ' | ||
| + | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, | ||
| + | })(); | ||
| </ | </ | ||
| - | | + | |
| + | |||
| + | |||
capri/search.1302608966.txt · Last modified: 2022/11/07 10:23 (external edit)