Updated: 2017-05-04 02:02:49 CST +08

Google Custom Search

search-result.html

<body>
    <div>
        <gcse:searchresults-only></gcse:searchresults-only>
    </div>
</body>

index.html

<form id="search-form">
    <input id="search-input" type="text"/>
    <input type="submit" value="submit"/>
</form>

index.js

$("#search-form").submit(function (event) {
    event.preventDefault();
    location.href = location.protocol + "//" + location.host + "/search?q=" + $("#search-input").val();
});

Reference

Reference