Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

how to move objects externally as JSON file instead of js variables?

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