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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:37:04+00:00 2026-06-03T22:37:04+00:00

I am looking for a way to append $.post() ‘s data response to the

  • 0

I am looking for a way to append $.post()‘s data response to the height of the li that invoked it.

I know it has been done, but I can’t find anything to read about it. So, any ideas?

Scheme

  • List item1

  • List item2

  • List item3, on click here :

                          * sublist item1
                          * sublist item2
                          * sublist item3
    
  • List item4

UPDATE

The only code I have is the working $.post() and I do a console.log(data) just to see the response.

Ok, I would like to achieve something like this: http://www.alistapart.com/d/horizdropdowns/horizontal.htm with the $.post()‘s response

  • 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-03T22:37:05+00:00Added an answer on June 3, 2026 at 10:37 pm
    $('li.clickable').on('click', function() {
      var list = $(this);
      $.ajax({
          url: 'url_to_script',
          method: 'post',
          success: function(res) {
    
             var response = $(res); // assume that you response contains li tags i.e '<li>subitem 1</li>' and more
             list.append(response); // append response to list that clicked
    
             /* >> OR  << */
             // if you response contains data as array/field
             $.each(res, function(index, data) {
                list.append('<li>'+ data['some_text'] +'</li>'); // some_text is assumed property, you have something else
             });
    
            // ACCORDING TO YOUR COMMENT
            var sublist = '<ul>';
            $.each(res, function(index, data) {
                sublist += '<li>'+ data['some_text'] +'</li>'; // some_text is assumed property, you have something else
             });
                sublist += '</ul>'; // now sublist is like <ul><li>...</li>....</ul>
            list.append(sublist); // append the sublist to ul.clickable
          }
      });
    });
    

    NOTE: You have to make some CSS to improve looks

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

Sidebar

Related Questions

I'm looking for the most efficient way to rename (append-1, -2 etc.) a variable,
My problem is that I was looking for way to use both storyboard and
I'm looking for a way to append text to the url with jQuery so
I'm looking for a good way to append an ellipsis, ..., when I need
I'm looking for a way to access the address bar search so that i
I'm looking for a way to attach a user data script to an EC2
I'm looking for a way to append elements with javascript using javascript. Basically I
Does anyone know of a way to append text to a stored procedure from
I was looking for a way to create modules that could easily be included
I'm looking for a way to have a javascript/jquery function that references dynamically created

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.