Last active
April 21, 2018 13:18
-
-
Save seantrane/1329661 to your computer and use it in GitHub Desktop.
HTML: Google WebSearch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://www.google.com/jsapi?key=XXXXXXXXXXXXXXX"></script> | |
<script type="text/javascript"> | |
google.load('search', '1'); | |
function OnLoad() { | |
var searchControl = new google.search.SearchControl(); | |
var webSearch = new google.search.WebSearch(); | |
var options = new google.search.SearcherOptions(); | |
var drawOptions = new google.search.DrawOptions(); | |
options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN); | |
drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_LINEAR); | |
webSearch.setSiteRestriction('www.domain.com'); | |
searchControl.addSearcher(webSearch, options); | |
searchControl.draw(document.getElementById("gresults"), drawOptions); | |
searchControl.execute('<?php echo $sSearchTerm; ?>'); | |
} | |
function DummyClipSearchResult(result) {} | |
google.setOnLoadCallback(OnLoad); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment