Articulate icon indicating copy to clipboard operation
Articulate copied to clipboard

Ajax search

Open wroughtec opened this issue 10 years ago • 1 comments
trafficstars

Is it possible to link up the search with an ajax call so that only the bare minimum of data comes through when I have tried a basic call it basically brings in the whole page in again (the correct data but includes the page header sidebar etc.):

<script>
    $(document).ready(function() {
        var content = $('#searchstring').val();
        $('#searchstring').keyup(function() {
            if ($('#searchstring').val() != content) {
                content = $('#searchstring').val();
                $.ajax({
                   type: "GET",
                   url: "@Url.ArticulateSearchUrl(Model)",
                   data: "term=" + content,
                   success: function(msg){
                     $('#blogresult').html(msg);
                   }
                 });
            }
        });
    });
</script>

wroughtec avatar Jun 17 '15 14:06 wroughtec

I could enable that by passing up a custom accept header or something. Otherwise you can create your own search endpoint and retrieve results that way.

Shazwazza avatar Jul 02 '15 08:07 Shazwazza