Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="cse" style="width: 100%;">Loading</div>
- <script src="http://www.google.com/jsapi" type="text/javascript"></script>
- <script type="text/javascript">
- google.load('search', '1', {language : 'en', style : google.loader.themes.V2_DEFAULT});
- google.setOnLoadCallback(function() {
- var customSearchOptions = {};
- var orderByOptions = {};
- orderByOptions['keys'] = [{label: 'Relevance', key: ''},{label: 'Date', key: 'date'}];
- customSearchOptions['enableOrderBy'] = true;
- customSearchOptions['orderByOptions'] = orderByOptions;
- var imageSearchOptions = {};
- imageSearchOptions['layout'] = google.search.ImageSearch.LAYOUT_POPUP;
- customSearchOptions['enableImageSearch'] = true;
- customSearchOptions['imageSearchOptions'] = imageSearchOptions; var customSearchControl = new google.search.CustomSearchControl(
- '012474349042792806020:alyx3vydvqu', customSearchOptions);
- customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
- customSearchControl.draw('cse');
- function parseParamsFromUrl() {
- var params = {};
- var parts = window.location.search.substr(1).split('\x26');
- for (var i = 0; i < parts.length; i++) {
- var keyValuePair = parts[i].split('=');
- var key = decodeURIComponent(keyValuePair[0]);
- params[key] = keyValuePair[1] ?
- decodeURIComponent(keyValuePair[1].replace(/\+/g, ' ')) :
- keyValuePair[1];
- }
- return params;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement