Articulate
Articulate copied to clipboard
Ajax search
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>
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.