我是否可以将搜索变量传递给我嵌入网站的Google自定义搜索引擎?我可以让搜索引擎工作,但无法通过POST传递术语(它来自网站其他页面上的搜索按钮)
我尝试了在此处找到的代码:http://code.google.com/apis/ajax/playground/?exp=search#hello_world
到目前为止,这就是我的代码...($q是我传递给它的术语)
<script type="text/javascript">
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);
</script>
谢谢