wyo schrieb:
I've a dynamically created array
var folders = new Array();
folders = <?PHP echo $json->encode ($folders) ?>;
and html created with
foreach ($folders as $key => $d) {
echo "<p id=\"f$key\" class=\"folder\">$d</p>";
}
and would like to bind a click handler to each element like
for (var i in folders) {
$('#f'+i).bind('click', function() {
...
});
}
yet the "$('#f'+i)" seems to be wrong. Any idea how to do that?
O. Wyss
The javascript part looks alright to me. Is there any data in the
folders array on the client side when the script gets executed? Do you
have a sample page online?
Cheers,
/rw