This question has been flagged
3568 Views

I'm trying to call a javascript code in XML file but it doesnt fires the action.

  <html>
   <head>
    <script type="text/javascript">
        function drawTree() {
          var data = [          
            {
             "firstname": "S",
              "lastname": "Brown",
              "age": 16,
            }];      
          var options = {
            'width': '400px',
            'height': '200px'
            };       
        var container = document.getElementById('mytree');
        var tree = new links.TreeGrid(container, options);      
        tree.draw(data);
        }
   </script>
 </head>
 <body onload="drawTree();">
  <div id="mytree"></div>
 </body>
</html>

Could please Anyone help me how to refine my code ?

Avatar
Discard