2
現在Googleカスタム検索を使用して結果ページにオートコンプリート機能がありますが、別のカスタム検索ボックスでオートコンプリート表示を表示するにはどうすればよいですか?カスタム検索ボックスにオートコンプリートを追加するGoogleカスタム検索
<script type="text/javascript">
$(document).ready(function() {
$("#googleCseSearchTextBox").keypress(function (e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13) { //Enter keycode
googleCseSubmit();
return false;
}
});
$("#googleCseSearchButton").click(googleCseSubmit);
});
function googleCseSubmit() {
window.location.href = "my site and key" + $('<div/>').text($("#googleCseSearchTextBox").val()).html();
};
</script>
カスタム検索ボックス:
<div>
\t <fieldset class="sfsearchBox">
<input name="googleCseSearchTextBox" type="text" id="googleCseSearchTextBox" class="sfsearchTxt" />
<input type="button" value="Search" id="googleCseSearchButton" class="sfsearchSubmit" />
</fieldset>
</div>
おかげ