我有一個谷歌網站搜索谷歌的免費網站搜索,後查詢
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");
});
這是不理想的,但工作正常。當用戶點擊搜索框時,它會將它們重定向到搜索頁面,以保存它們雙重輸入查詢。
感謝您的幫助!