how to move objects externally as JSON file instead of js variables? //moving this to external JSON and calling it
var info = [
{"name":"John","city":"Melbourne, Australia"},
{"name":"Mark","city":"Los Angeles, USA"},
{"name":"Patel","city":"Heathrow, London"},
{"name":"Lee","city":"Hong Kong"},
];
var dataOptions2 = { keys: ["name", "city"] };
var options2 = { display: "city", key: "name", dataOptions: dataOptions2 };
var dataOptions3 = { keys: ["itemName"] };
var options3 = { display: "itemName", key: "itemCity", dataOptions: dataOptions3 };
$(document).ready(function(){
$("#infoPicker").fuzzyComplete(info, options2);
$('input').on('keyup blur', function() {
$(this).parent().find(".output").html($(this).parent().find("select").val());
});
});
Comments
Post a Comment