Google免费站点搜索,发布查询
|
我有一个Google网站搜索
http://www.google.com/cse/manage/create
这给了我下面的工作代码:
<div id=\"cse\" style=\"width: 100%;\">Loading</div>
<script src=\"http://www.google.com/jsapi\" type=\"text/javascript\"></script>
<script type=\"text/javascript\">
google.load(\'search\', \'1\', { language: \'en\' });
google.setOnLoadCallback(function () {
var customSearchControl = new google.search.CustomSearchControl(\'013080392637799242034:ichqh_hal4w\');
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
customSearchControl.draw(\'cse\');
}, true);
</script>
在我的某些页面上,我有一个搜索框。我可以在搜索框中输入文本,发布到该网站的搜索脚本并加载吗?
例如:
用户位于Home.html上
他们在搜索框中输入文字
将它们重定向到Search.html
Search.html接受他们输入的文本并进行搜索,而无需在空白框中重新输入文本。
目前,我有:
// Temporary measure
SearchBox.click(function (event) {
SearchBox.attr(\'disabled\', \'disabled\');
SearchBox.css(\"background\", \"#efefef\");
window.location.replace(Domainroot + \"/search\");
});
这不是理想的,但可以。用户单击搜索框时,会将他们重定向到搜索页面以保存它们,并输入两次查询。
谢谢你的帮助!
没有找到相关结果
已邀请:
2 个回复
浅镁
笛驮型迸