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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:56:05+00:00 2026-05-18T01:56:05+00:00

I am using jQuery and a Java based backend system. I am a newbie

  • 0

I am using jQuery and a Java based backend system. I am a newbie with jQuery / AJAX and I want to do a first call.

I have this kind of HTML list:

<ul>
    <li>Test 1</li>
    <li>Test 2</li>
    <li>Test 3</li>
</ul>

This content should be fetched from the backend system. How can I do this? Are there any tutorials? If it is one value, it is clear to me, I can tell for example a text input field that the values should be the result of the AJAX call.
But what about such a HTML list? How should I prepare the JSON message in the backend system, how to handle in the frontend system?

Best Regards

  • 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-18T01:56:06+00:00Added an answer on May 18, 2026 at 1:56 am

    In such cases it’s best to render some javascript server-side and use jQuery getScript function. So you would do something like (it’s a pseudo-code, you should adapt it for your Java backend):

    s = escape_javascript(render_new_list());
    return "$('#mylist').html(" + s + ");";
    

    You could also render only the list and at client side do:

    $.get(url, function (data) {
      $('#mylist').html($(data));
    }, 'text');
    

    If you really want to use JSON then something like this should work:

    $.getJSON(url, function(data) {
      var l = $('#mylist').empty();
      $.each(data, function(index, value) {
        l.append($('<li>' + value + '</li>'));
      });
    });
    

    Assuming you send list of values you want displayed ([“test1”, “test2”] for example).

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

Sidebar

Related Questions

This is my html (im using Galleria Image Gallery - JQuery Based) <div id=galleria>
Using jquery how do I focus the first element (edit field, text area, dropdown
Using jQuery, how do I delete all rows in a table except the first?
Using jQuery, how would you find elements which have a particular style (eg: float:
When using jQuery 's ajax method to submit form data, what is the best
I want to test a Ajax based web application. I want to write the
I am using this jquery ui autocomplete but i need to grab the data
I'm using Java at the core backend and JSP pages as GUI frontend. and
I'm trying to create a AJAX based SQL query with Java EE and Servlets.
Using jQuery , how can I dynamically set the size attribute of a select

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.