List load json data does not work if I place a callback function, but xml works fine

I try the List sample:
and place a callback function in the loading method as follow:

Loading data from JSON file p{ font-size:14px; margin: 0.3em; }

Loading JSON data from file

it does not work, but I try another sample that loading the xml file, it works fine:

Loading data from XML file function doOnLoad() { myList = new dhtmlXList({ container:"data_container", template:"#name##address#
#city#", type:{ height:"auto" } }); // I edited the code here myList.load("../common/list.xml",function(text){ alert(text);
<style type="text/css">
	margin: 0.3em;

Loading XML data from file

why? is that a bug here?

I apologize, the correct format is:

	myList.load("../common/list.json", "json",function(text){ alert(text);});

We’ll fix the the documentation as soon as possible.

1 Like

Hi, sematik
Thank you very much!