test-page

function displayTerminalConfig(){
console.log(‘fetching terminal info’);
$.ajax({
url: “http://localhost/api/stores/terminalinfo”,
contentType: ‘text/plain’,
type: ‘GET’,
success: function(res) {
var response = JSON.parse(res);//convert string response to JSON object
console.log(response.city);//properties can ve accessed by name
for (var key in response) {
if (response.hasOwnProperty(key)) {
$(‘#term_info’).append(‘

  • ‘+key + ‘: ‘ + response[key]+’
  • ‘);
    }
    }
    }
    });
    }
    displayTerminalConfig();

    This is the terminal info: