Hi!
First of all, I want to say that I’m relatively new in Jquery usage. I’m using the jqxtree plugin to load a tree using ajax on demand. In the example, you use static files, and I want to use a perl script to load the data.
My root JSON looks like:
[{"label": "Folder Roor","items": [ { "value": "../../cgi-bin/AJAXtree.cgi", "label": "Loading..." }]}]
And the CGI simple returns the content of ajax1.htm. The content returned looks like that:
Content-type: application/json
[{ "label": "Folder 1", "items": [{ "value": "ajax.htm", "label" : "Loading..." } ] },{ "label": "Folder 2", "items": [{ "value": "ajax.htm", "label" : "Loading..." } ] },{ "label": "Folder 3", "items": [{ "value": "ajax.htm", "label" : "Loading..." } ] }]
It seems that the JS capture the data send by the CGI, but in FireBug I get this error: JSON.parse: unexpected character
But It seems all correct… You can try it here