You need to use what's called a method closure.  Essentially, it's a  
function that returns a function.  Something like this:

function myClosure(searchString){
  return function(){
   // you can access searchString here
   // and do stuff with the results, too!
  }
};

searcher.setSearchCompleteCallback(searcher, myClosure(searchString));
searcher.execute(searchString);

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 Aug 7, 2009, at 4:48 PM, Yusuf wrote:

>
> Hi,
>
> How do I obtain the search string in the callback function?
>
> I am performing multiple searches for images at a time and I need to
> associate each search result back to the exact string used to perform
> the search. How do I get that?
>
> Thanks,
> Yusuf
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to