title: Pass variable to Google Custom Search Engine
body: <p>Is it possible to pass a search variable into the Google Custom Search Engine that I have embedded on my website? I can get the search engine to work, but I can't pass it a term via POST (it's coming from a search button on other pages of the website)</p>
  
  <p>I tried to hack the code I found here: <a href="http://code.google.com/apis/ajax/playground/?exp=search#hello_world" rel="nofollow noreferrer">http://code.google.com/apis/ajax/playground/?exp=search#hello_world</a></p>
  
  <p>And this is what I have so far... ($q is the term I am passing to it)</p>
  
  <pre class="lang-js prettyprint-override"><code>&lt;script type="text/javascript"&gt;
      google.load('search', '1', {language : 'en'});
  
      function OnLoad()
      {
          var customSearchControl = new google.search.CustomSearchControl('***my key****');
          customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
          customSearchControl.draw('cse');
          searchControl.execute("$q");
      }
      google.setOnLoadCallback(OnLoad);
  &lt;/script&gt;   
  </code></pre>
  
  <p>Thanks</p>