How do i pass an argument from a javascript tree to a JSP page

B

bala

I have a javascript tree which lists the folders on my system. Whenever
i click on a node on the tree, i need to pass the name of that node to
a JSP file to retrieve the contents of that folder which in turn will
be displayed as a JSP page. The javascript tree is constructed using a
separate ".js" file using functions to create the root and nodes. Can
anyone help me with this? Thanks in advance.

Bala
 
A

Andrew Thompson

I have a javascript tree which lists the folders on my system.

c.l.js is what you need,
..Whenever i click on a node on the tree, i need to pass
the name of that node to a JSP file ..

...because it is the same process in JS to send URL parameters to
a page written in ASP, JSP, PHP or HTML.

[ But a word of advice. Do not even *mention* JSP on c.l.js,
or you risk people shooing you straight back here. It is enough
to specify that you need to send URL parameters to 'another page'. ]
 
G

gimme_this_gimme_that

If you can add an onClick method to your note and assign a javascript
variable that will work

The psuedo code would be :

<html>
<head>
<script>
var which_node = '';

function myOnClick() {
aform.current_node.value=which_node;
}
</script>
</head>
<body>

The trick is to use an onclick method and assign the
value of a hidden variable.


<form name=aForm >
<input type=hidden name=current_node >
<node_thing onClick="which_node=node1>
<node_thing onclick="which_node=node2>
</form>
</body>
</html>

If there is no form on the page you have to fetch the
current_node html element by iterating through
the Document object.
comp.lang.javascript might have been a place to cc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top