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 8552799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:30:24+00:00 2026-06-11T14:30:24+00:00

I have a jsp webpage which is dynamically generated. I want to have tooltips

  • 0

I have a jsp webpage which is dynamically generated. I want to have tooltips on some of the images and the tooltip script I am using requires that each image to have a unique id and the $(document).ready(function(){}); refer to that image id. Is this possible? I can easily generate a unique id for the html img tag but when I try to do the same for the script it gives an error. I have included my code.

<logic:iterate id="results" name="appStatus" scope="session">
    <logic:equal name="results" property="name" value='<%= name%>'> 
        <td>
            <logic:equal value="up" name="results" property="status">
                <img src="img/status_up.png">
            </logic:equal>
            <logic:equal value="down" name="results" property="status">
                <img id="alert" src="img/status_alert.png">
                <div class="tooltip">
                    <bean:write name="results" property="description"/>
                </div>
                <script>
                    $(document).ready(function() {
                        $("#alert").tooltip({ position: 'right top', effect: 'slide'});
                    });
                </script>
            </logic:equal>
            <logic:equal value="other" name="results" property="status">
                <img id="other" src="img/status_info.png">
                <div class="tooltip">
                    <bean:write name="results" property="description"/>
                </div>
                <script>
                    $(document).ready(function() {
                        $("#other").tooltip({ position: 'right top', effect: 'slide'});
                    });
                </script>
            </logic:equal>
        </td>
    </logic:equal>
</logic:iterate>

so for this code each img with id “alert” would need to have its own unique id and the document ready script would need to refer to that.

  • 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-06-11T14:30:25+00:00Added an answer on June 11, 2026 at 2:30 pm

    Give the <img> a unique id:

    <img id="alert<c:out value='${indexNum}' />" src="img/status_alert.png">
    

    and likewise in the script:

    $(document).ready(function() {
                            $("#alert<c:out value='${indexNum}' />").tooltip({ position: 'right top', effect: 'slide'});
                        })
    

    So the ids will be alert0, alert1, etc. indexNum is the name I’ve given the iteration number variable, specify the name for it like this:

    <logic:iterate id="results" name="appStatus" scope="session" indexId="indexNum">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webpage in which I am using 2 jsp:include directives. Basically one
I have a jsp that contains a table with some information from db. I
I have a webpage that makes an ajax call to get some data. That
I have created a chart using JFreeChart inside a JSP. I want to render
I have a script that parses certain elements from a webpage and stores them
I have a webpage which shows some info. In my webpage I have many
I have written a webpage with GWT which contains auto-generated Hyperlinks. These hyperlinks currently
I want to print some java, jsp code on webpage in an indented format.
I have a jsp page, which imports another jsp. This import is wrapped into
I have a JSP java application that has a name AAA-master so currently my

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.