Created
November 15, 2011 02:34
-
-
Save Nub/1365955 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* | |
| * How to search for images and restrict them by color. | |
| */ | |
| google.load('search', '0'); | |
| function OnLoad() { | |
| // Create a search control | |
| var searchControl = new google.search.SearchControl(); | |
| // Create an ImageSearch | |
| var imageSearch = new google.search.ImageSearch(); | |
| //imageSearch.setRestriction(google.search.ImageSearch.RESTRICT_COLORIZATION, | |
| // google.search.ImageSearch.COLORIZATION_GRAYSCALE); | |
| // Add the searcher to the SearchControl | |
| searchControl.addSearcher(imageSearch); | |
| // tell the searcher to draw itself and tell it where to attach | |
| searchControl.draw(document.getElementById("content")); | |
| // Find me something fit for a fairytale | |
| searchControl.execute('KROQ logo'); | |
| } | |
| google.setOnLoadCallback(OnLoad); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment