0

I am trying to build a file tree structure using jquery.I came across this link

http://www.abeautifulsite.net/blog/2008/03/jquery-file-tree/

So i tried to use it.Below is the html source code of my file.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<script src="js/jquery-1.7.2.js" type="text/javascript"></script>
<script src="js/jquery.easing.js" type="text/javascript"></script>
<script src="js/jqueryFileTree.js" type="text/javascript"></script>
<link href="css/jqueryFileTree.css" rel="stylesheet" type="text/css"
    media="screen" />

<script type="text/javascript">
$(document).ready( function() {
    $('#container_id').fileTree({ root: '/some/folder/' }, function(file) {
        alert(file);
    });
});
</script>
</head>
<body>
    <div id="container_id"></div>
</body>
</html>

But when I open this page in a browser it shows a blank page.Nothing appears.Am I missing something?Please help.Thnx in advance.

Note:All the src of script tags are correct.

1
  • what errors do you see in your console ? Commented Jun 22, 2012 at 5:51

1 Answer 1

1

Finally I resolved it.Thanks to Mozilla's FireBug.So I thought I should write the solution as well:- In the Script Tag above,after specifying the root folder,we should use a connector which will take the path and fetch the file tree from this path along with all its child.

In my scenario,I used jsp connector.All these connectors can be downloaded http://labs.abeautifulsite.net/archived/jquery-fileTree/jquery.fileTree-1.01.zip

Make the below changes to above embedded script code

$(document).ready(function() {
$('#container_id').fileTree({
root : '/home/abhinav',
script : 'jqueryFileTree.jsp'
}, function(file) {
alert(file);
});
}); 

Then our File tree is ready...:)

Sign up to request clarification or add additional context in comments.

1 Comment

Is there the possibility to create a static file-tree from a given String in JavaScript? So without any server-side component?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.