Well, there are three ways to do this, depending on what you're trying
to do.
1. Use a search complete callback (i.e.,
control.setSearchCompleteCallback) to call
container.getElementsByTagName('a'), where container is the containing
element of your search control, to obtain an array of all the links in
your control. Then loop through them and add the onclick listener.
2. Override the searchers' default .createResultHtml method with one
that builds your own node, which would include the onclick.
3. Roll your own custom control which will generate its own html
The first is probably the easiest, but also the least flexible (and
maybe least reliable). The second is not particularly difficult, but
it's definitely more advanced than the first. And the third, while
certainly the most involved, is actually a lot easier than it sounds,
and will probably ultimately produce the best, most flexible solution.
Jeremy R. Geerdes
Effective website design & development
Des Moines, IA
For more information or a project quote:
http://jgeerdes.home.mchsi.com
http://jgeerdes.blogspot.com
http://jgeerdes.wordpress.com
[email protected]
Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.
If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!
And check out my blog, Adventures in Web Development, at
http://jgeerdes.blogspot.com
!
On May 19, 2009, at 6:40 AM, Vikram Kumar wrote:
> Hello,
> I am using GSearchControl, can anybody tell me how to add
> onClick events to the links/results returned by google search api.
>
> thanks and regards
> vikram kumar
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google AJAX APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-AJAX-Search-API?hl=en
-~----------~----~----~----~------~----~------~--~---