I am not able to detect why my ajax call do not work. I am trying to read the contents of text file but it do not work, The problem is control never go to .done(function(data))
function makeCustomerTree()
{
// debugger
alert('customertree');
$.ajax(
{
url:"~/bootstrap/js/LiveMap/Ajax/JsonStringCarryingData/customer-tree-json.txt",
data: {},
type: "GET"
}).done(function (data)
{
alert('done');
$('#tree_loader').html('');
tree = $.fn.zTree.init($("#customerTree"), setting, data);
tree = $.fn.zTree.getZTreeObj("customerTree");
}).fail(function (jqXHR)
{
alert('fail');
$('#tree_loader').html('<font color="red">Unable to load.</font>');//jqXHR.responseText);
});
}
Where my file customer-tree-json.txt contains the contents like this:
[
{
"icon": "/static/tree/icons/user-20.png",
"pId": 7,
"id": 18,
"itemType": "lcustomer",
"name": "sachin bhatia"
},
{
"itemType": "ldevice",
"pId": 18,
"name": "UK 06 AA 3840",
"open": true,
"id": "007060500336",
"icon": "/static/tree/icons/device-20.png"
}
]