Advertisement
Guest User

Untitled

a guest
Aug 28th, 2012
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. <div id="cse" style="width: 100%;">Loading</div>
  2. <script src="http://www.google.com/jsapi" type="text/javascript"></script>
  3. <script type="text/javascript">
  4. google.load('search', '1', {language : 'en', style : google.loader.themes.V2_DEFAULT});
  5. google.setOnLoadCallback(function() {
  6. var customSearchOptions = {};
  7. var orderByOptions = {};
  8. orderByOptions['keys'] = [{label: 'Relevance', key: ''},{label: 'Date', key: 'date'}];
  9. customSearchOptions['enableOrderBy'] = true;
  10. customSearchOptions['orderByOptions'] = orderByOptions;
  11. var imageSearchOptions = {};
  12. imageSearchOptions['layout'] = google.search.ImageSearch.LAYOUT_POPUP;
  13. customSearchOptions['enableImageSearch'] = true;
  14. customSearchOptions['imageSearchOptions'] = imageSearchOptions; var customSearchControl = new google.search.CustomSearchControl(
  15. '012474349042792806020:alyx3vydvqu', customSearchOptions);
  16. customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
  17. customSearchControl.draw('cse');
  18. function parseParamsFromUrl() {
  19. var params = {};
  20. var parts = window.location.search.substr(1).split('\x26');
  21. for (var i = 0; i < parts.length; i++) {
  22. var keyValuePair = parts[i].split('=');
  23. var key = decodeURIComponent(keyValuePair[0]);
  24. params[key] = keyValuePair[1] ?
  25. decodeURIComponent(keyValuePair[1].replace(/\+/g, ' ')) :
  26. keyValuePair[1];
  27. }
  28. return params;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement