/example/spice.html
HTML | 46 lines | 14 code | 9 blank | 23 comment | 0 complexity | 9e70dd7e9cb805772b5ae81c71781836 MD5 | raw file
- <html>
- <head>
- <!--
- This is the function you define -- see its details in the repository.
- //-->
- <script type="text/javascript" src="example/spice.js"></script>
- <!--
- This is a stub function that takes what you pass it
- and creates the Zero-click Info that gets shoved
- into the body of the page in the div marked "a".
- //-->
- <script type="text/javascript">
- function nra(items) {
- document.getElementById('a').innerHTML = items[0]['a'];
- }
- </script>
- </head>
- <body>
- <!--
- This is a placeholder div for the Zero-click Info that nra() populates
- //-->
- <div id="a"></div>
- <!--
- We call the external script here.
- All excternal calls go through our server for security and privacy, e.g.
- we strip referer headers so search terms don't leak and we can hide api keys.
- We can also change the response so it goes into JSONP format,
- which means it calls your function directly.
- If the provider already has JSONP you can use it for testing directly.
- The /ir/ piece will change for each endpoint, e.g. /ib/ for bitcoin.
- //-->
- <script type="text/javascript" src="http://duckduckgo.com/ir/Philadelphia"></script>
- </body>
- </html>