I am currently having an with my jQuery, Below is the code that generates a list via PHP and the list is then clickable to create a list of the sub contents of that folder.
I have a jsfiddle of this working: here
However when run on my page it is not running; the issue seem to be replicated when selecting "No wrap - in ".
I honestly don't know anything about these 4 jsfiddle options, it works in 3 but not 4. This may have been a stupid oversight by me or I may be missing some form of critical info
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<?php
if ($handle = opendir('fileServer')) {
while (false !== ($file = readdir($handle)))
{
if (($file != ".")
&& ($file != ".."))
{
$thelist .= '<LI id='.$file.'>'.$file.'';
}
}
closedir($handle);
}
?>
<script type="text/javascript">
function genCont(){
// alert(sel + "folder selected")
//This is the alert that works in JSfiddle but not on my Rpi :(
$("#fList li").click(function() {
alert(this.id); // get id of clicked li used in below PHP
});
//future unused code, suggestion for improvement are, of course, welcome
//var fName = sel;
<?php
if ($handle = opendir(/*not used yet*/)) {
while (false !== ($file = readdir($handle)))
{
if (($file != ".")
&& ($file != ".."))
{
$thelist2 .= '<LI><a href="'.$file.'">'.$file.'</a>';
}
}
closedir($handle);
}?>
}
</script>
<div class="fsFolder">
<ul id="fList">
<?=$thelist?>
</ul>
</div>
Thank you ahead of time SO
Kris