asp.net mvc - Why my ajax call do not work? -
i not able detect why ajax call not work. trying read contents of text file not work, problem control never go .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 load.</font>');//jqxhr.responsetext); }); }
where file customer-tree-json.txt contains contents 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" } ]
after seeing directory tree, relative url has :
url:"/bootstrap/js/livemap/ajax/jsonstringcarryingdata/customer-tree-json.txt"
Comments
Post a Comment