Topic: test the return of the load -url function

Hello to all,

After I've loaded the json from a certain url I want to test what I got back from this url.

 .load({
           
         url: "../certainUrl
                 
           

    })

For example I want to test whether the return is a jsonString or an ordinary html side.

Is it possible to check this?

Re: test the return of the load -url function

You should replace Mif.Tree::load, Mif.Tree.Node::load with your own functions, or rewrite only onSuccess function

tree.load({
     url: some_url,
     onSuccess: function(json){
            console.log(this.response.text);
            //do something with this.response.text
            if(tree.forest){
            tree.root=new Mif.Tree.Node({
                tree: tree,
                parentNode: null
            }, {});
            var parent=tree.root;
        }else{
            var parent=null;
        }
        Mif.Tree.Load.children(json, parent, tree);
        Mif.Tree.Draw[tree.forest ? 'forestRoot' : 'root'](tree);
        tree.$getIndex();
        tree.fireEvent('load');
        return tree;
     }
});
node.load({
   onSuccess 
....

Re: test the return of the load -url function

do you know how to get the responseHeader??
this.response.getHeader() doesn't work...

Re: test the return of the load -url function

this.getHeader(name) ?