Hello
I found this really nice JS Tree script,
http://www.destroydrop.com/javascripts/tree/,
and I want to populate the tree with data from
MySQL but can’t get it to work.
I tried ob_start() without any luck
and a wrapper:
test.php:
<html>
<body bgcolor=“#FFFFFF”>
<h1>JS Tree</h1>
<script language=“JavaScript” type=“text/javascript” src=“js.php”></script>
</body>
</html>
js.php:
<?php
header(“Content-Type: text/javascript”);
…
connect to mysql
make query
…
?>
document.write('JS Tree'); //Working
d = new dTree('d');
d.add(0,-1,'My example tree');
d.add(1,0,'<?php echo $mysqlfield;?>','example01.html');
d.add(2,0,'Node 2','example01.html');
document.write(d);
but it don’t work. It doesn’t output the tree at all,
only document.write(‘JS Tree’);
Anybody?