Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6022869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:55:16+00:00 2026-05-23T03:55:16+00:00

I have the need to pass an object from jstl to a Jquery click

  • 0

I have the need to pass an object from jstl to a Jquery click handler.

My UI displays a tree structure. The nodes which make up the tree use a name property which is the value displayed to the user. This name property is taken from a “node” object. Is there any way i can pass the “node” object into my jquery function when one of the nodes of the tree is clicked?

My jstl looks like this

<c:forEach var="node" items="${object.childItems}">
<li>
        <a href="#" class="node"><c:out value="${node.name}"/></a>
    <c:set var="node" value="${node}" scope="request"/> 
    <jsp:include page="child.jsp"/>
</li>
</c:forEach>

I then have a jquery click event attached to the “.node” class of each href. When the href is clicked i want to be able have access to all the values in “node” in my Jquery click handler. What is the best way to do this? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:55:16+00:00Added an answer on May 23, 2026 at 3:55 am

    You have few options available depending on what you want to do?

    1. You can store the node values in the HTML as IDs/hidden fields or using Data attributes then when in our click event handler you get use jQuery selector to build a JSON object.
    2. You can just store the ID of the node then make an Ajax request to the server that can return a JSON object.

    I normally use option 1 if all the data I need for the object is already being displayed on the page already to reduce the number of server calls.

    Or option 2 if the object has extra fields you want to access in your but don’t need to display on the list to reduce the bloat in your HTML page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two activities in which I need to pass an object array between
I have a dict, which I need to pass key/values as keyword arguments.. For
I have a rather silly question, I need to pass a parameter from one
I have a java application I need to pass some info to a C++
I have a user control in a repeater that I need to pass data
I have a .NET program and a Borland Win32 program that need to pass
I have need to select a number of 'master' rows from a table, also
I have a need to close a parent form from within child form from
Have any ways to keep a variables (object) in a page scope? I need
I need to pass an array from JavaScript to a page method in C#.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.