I have a Json(config/server.json) config file which has server configuration. eg:
{
"server": "127.0.0.1"
}
I want to read that 'server' parameter and assign that value to my other jquery functions.
eg:
var server = ""; $(document).ready(function() { loadConfigFile(); loadCustomers(); }); function loadConfigFile() { $.getJSON('config/server.json', function(jd) { $.each(data.server, function(i,s){ alert(s); }); }); }; function loadCustomers() { $ .ajax({ type : 'GET', url : server+':8080/cache/getCustomers', ... }
My loadConfig file is not reading the JSOn file..What im doing wrong here?