jQuery SearchBox is a jQuery plugin that will provide an easy way to add quicklinks support to your search box. Like this:
The plugin can make the basic feature.
<script type="text/javascript" charset="utf-8">
$(function() {
// Ajax Example
//$('#s-keyword').searchbox({
// resultsArea: '#s-results'
// , trigger: function(keyword) {
// var data = { q: { name_cont: keyword }};
// $.ajax({
// url: '/products/search',
// type: 'get',
// context: this,
// data: data,
// dataType: 'html',
// success: this.updateResultsArea
// });
// }
// });
$('#s-keyword').searchbox({
resultsArea: '#s-results'
, trigger: function() {
var testData = ''; // Add your code here.
this.updateResultsArea(testData);
}
});
})
</script>
jQuery-searchbox is released under the MIT license.