title: Deciphering the Google Search API: how to refer to an argument passed into callback function?
body: <p>I'm using the Google Search API to load some Search results into my page.  I'd like to set an argument to the callback function that says which div the search results should attach themselves to.</p>
  
  <p>Here's the callback function definition, per Google:</p>
  
  <p>.setSearchCompleteCallback(object, method, opt_arguments?)</p>
  
  <p>Here's how I'm doing it:
  <code>
  searcher.setSearchCompleteCallback  (document, function() { alert(opt_arguments[0].id); }, new Array(infodiv) );
  </code></p>
  
  <p>The documentation explains: "Applications may optionally pass in a context argument using opt_arguments which is then passed to the specified method."</p>
  
  <p>Yes -- but how?  I've passed in the context argument, but how do I refer to it within the function?  I've tried just calling opt_arguments, but js errors clearly show that it's not defined.</p>
  
  <p>The documentation is <a href="http://code.google.com/apis/ajaxsearch/documentation/reference.html" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Thank you!!</p>