是否可以将搜索变量传递到我嵌入在我的网站上的 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>
谢谢