Im trying to use this plugin to filter through an employee list but until i hard code the HTML its doesnt match any entries :( Im using ajax to write out the data to suit the html and im sure my output is fine. But when i load the page its all showing zeros and no matches :(
<script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript"></script><script src="http:///sites/dev/SiteAssets/ListNav/jquery-listnav.js" type="text/javascript"></script><link rel="stylesheet" type="text/css" href="http:///sites/dev/SiteAssets/ListNav/demo.css"/><link rel="stylesheet" type="text/css" href="http:///sites/dev/SiteAssets/ListNav/listnav.css"/><script type="text/javascript">
// begin work to call across network
var requestUri = "http://dev-melsp01:1655/sites/dev/_api/Web/Lists/getByTitle('Contact')/items?$select=FirstName,Title";
// execute AJAX request
$.ajax({
url: requestUri,
type: "GET",
headers: { "ACCEPT": "application/json;odata=verbose" },
success: function(data){
//alert(data.d.FullName);
var newRows = "";
for (var i = 0; i < data.d.results.length; i++) {
newRows +="<li>";
newRows +="<a href='#'>" + data.d.results[i].FirstName + "</a>";
newRows +="</li>";
}
$("#demoSix").prepend(newRows);
//Working and can print out the html fine
alert(newRows);
},
error: function(){
alert("Failed to get customer");
}
});
</script><script type="text/javascript">
$(document ).ready(function() {
$('#demoSix').listnav({
});
});
</script>
//appending data to the UL element
<ul id='demoSix' class='demo'></ul>