Save a copy of the Google
Ajax Search API key for use in a Google Ajax search application.
10.3 Overview of Google Ajax Search API
The main class of the Google Ajax search API is GSearchControl,
which provides the user interface for a search performs the search using
the different searcher objects. Some of the commonly used methods of the
GSearchControl class are discussed in Table 10.1.
Table 10.1 GSearchControl Methods
Method Description
addSearcher Adds a searcher to the search control object.
draw Binds the search control object to the HTML
container. The search results are displayed in a
specified DOM element.
execute Initiates a search across the different searchers
specified in the search control using a specified
search term.
setResultSetSize Sets the result set size. Specifies the number of
results in the result set. Values that may be
specified are GSearch.LARGE_RESULTSET,
which corresponds to 8 results, and
GSearch.SMALL_RESULTSET, which
corresponds to 4 results.
clearAllResults Clears all the search results from the search
control.
setLinkTarget Specifies the link target for links embedded in
search results. Default value is
GSearch.LINK_TARGET_BLANK, which opens
a link in a new window.
setSearchCompleteCallback Specifies a callback method that is invoked when
the search is complete.
setSearchStartingCallback Specifies a callback method that is invoked when
the search begins.
Pages:
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178