I have been stuck on this all day, the getJSON just isn't working, I have tried loads of examples, but it still isn't working... Any help would be great. Thanks!
console.log("hi");
$.getJSON("https://pod.cscf.me/conversations/new.json", function(result)
{
console.log("workingggggg");
$.each(result, function(i, person)
{
console.log("itworks2");
});
});
It only outputs the first console log "hi".
Here is the code from the new.JSON file:
<script>
//<![CDATA[
$(document).ready(function () {
var data = $.parseJSON( "[{\"value\":\"32\",\"name\":\"R M\"},{\"value\":\"17\",\"name\":\"[email protected]\"},{\"value\":\"15\",\"name\":\"Henry Hoggard\"},{\"value\":\"26\",\"name\":\"[email protected]\"}]" ),
autocompleteInput = $("#contact_autocomplete");
autocompleteInput.autoSuggest(data, {
selectedItemProp: "name",
searchObjProps: "name",
asHtmlID: "contact_ids",
retrieveLimit: 10,
minChars: 1,
keyDelay: 0,
startText: '',
emptyText: 'No Results Found',
preFill: [{name : "",
value : ""}]
});
autocompleteInput.focus();
});
//]]>
</script>
I want to access the var data = $.parseJSON etc section (contains the names and IDs)