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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:38:02+00:00 2026-06-02T15:38:02+00:00

I have to work through some code and found the following function, which I

  • 0

I have to work through some code and found the following function, which I do not understand. What does hintContainer, it grabs the return-value of each() and it seems that this object should be placed inside the callback-function?

Thanks in advance for any guesses, unfortunately I cannot contact the developer. In short, the function should grab all divs with the class userHinterPanel und should show them.

function prepareHintMessages() {
// gets all userHintePanels
var hintContainer = jQuery('div.userHintPanel').each(function() {
    hintContainer = jQuery(this);
    // hint content div
    var hintContent = hintContainer.next();
    // hint content text
    var closeText = hintContainer.find('div.closeTextContainer');
    // inserts text into the content container
    hintContent.insertBefore(closeText);
    // show the complete hint panel
    hintContainer.parent().show();
});
}

UPDATE HTML Snippet, this is the info-Box:

<form id="form" name="form" method="post"
action="xxx.jsf"
enctype="application/x-www-form-urlencoded" class="newPatientForm">
<div id="form_showAllHintsContainer" class="showAllHintsContainer"
    onclick="jQuery('#form_showAllUserHints').click();"
    title="Alle verfügbaren Hinweise auf dieser Seite einblenden">
    ?<input class="hidden" id="form_showAllUserHints"
        name="form_showAllUserHints"
        onclick="A4J.AJAX.Submit('form',event,{'oncomplete':function(request,event,data){prepareHintMessages();},'similarityGroupingId':'form_showAllUserHints','parameters':{'userPrefActionParamShow':'NEW_PATIENT_HINT','form_showAllUserHints':'form_showAllUserHints'} } );return false;"
        value="showUserHints" type="button" />
</div>
<div class="generalPadding">
    <div id="form_hintRerenderContainer">
        <div id="form_newPatientHintWithIsh"
            class="userHintPanelContainer newPatient">
            <div id="form_newPatientHintWithIshHintPanel"
                class="alert-message block-message warning userHintPanel">
                <a href="#" onclick="closeHintMessage(this);"
                    title="Hinweis ausblenden" class="close">×</a>
                <div class="header">Hinweis</div>
                <div class="text">
                    <div class="closeTextContainer"
                        style="position: relative; height: 20px;">
                        <a href="#" onclick="closeHintMessage(this);"
                            style="font-size: 14px;" class="close"> Hinweis ausblenden</a>
                    </div>
                </div>
                <input class="hidden hideHintButton"
                    id="form_newPatientHintWithIshHintPanelHideButton"
                    name="form_newPatientHintWithIshHintPanelHideButton"
                    onclick="A4J.AJAX.Submit('form',event,{'similarityGroupingId':'form_newPatientHintWithIshHintPanelHideButton','parameters':{'form_newPatientHintWithIshHintPanelHideButton':'form_newPatientHintWithIshHintPanelHideButton','userPrefActionParam':'NEW_PATIENT_HINT'} } );return false;"
                    value="hideUserHints" type="button" />
            </div>
            <div class="hintContent">
                <ul>...</ul>
            </div>
        </div>
    </div>
  • 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-02T15:38:05+00:00Added an answer on June 2, 2026 at 3:38 pm

    It graps all elements with class “userHintPanel” and adds some content just before the close text container and after that shows all prepared userHintPanels

    One thing:

       var closeText = hintContainer.find('div.closeTextContainer'); is a bit strange. 
    

    It targets something that looks like this:

       <div class="closeTextContainer">Panel x Close</div>
    

    But in your code it won’t grab the text, but the element itself. Did the developer mean this perhaps?

        var closeText = hintContainer.find('div.closeTextContainer').text(); 
    

    If it’s really the intend to to grab the element, better rename the var to ‘closeTextElement’ for better understanding of the code.

    Another weird thing:

    var hintContent = hintContainer.next();
    

    This will result in that at the last userHintPanel, hintContent is ‘undefined’. Is that the intend?

    Another very important thing:

    Is the parent of userHintPanel an iFrame? If that’s the case the following statement will fail for sure in Safari:

       hintContainer.parent()
    

    The error you should get is: SCRIPT5022: DOM Exception: HIERARCHY_REQUEST_ERR (3)

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

Sidebar

Related Questions

Possible Duplicate: How does foreach work when looping through function results? If I have
I was going through some code at work and I found this inline FLAGS
The commandlink link2 does not have work after an ajax call is made to
I have rewritten the Binary Search Tree code found in the following links to
I have some VB code which makes use of a COM api and results
I have some Repository. Work with them is realized through an interface IRepository .
I was going through some java code(which uses playframework ) that provides some shopping
In my project I have the following helper method, which goes through all the
I have a reference application that I use to work through DDD issues, and
I have to work with strings which may contain Lat/Long data, like this: $query

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.