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

  • Home
  • SEARCH
  • 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 7558739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:26:56+00:00 2026-05-30T12:26:56+00:00

Ok, Ive got a Java Servlet returning some JSON (In Application/JSON format). To do

  • 0

Ok, Ive got a Java Servlet returning some JSON (In Application/JSON format). To do this, im using the GSON libary.

The Servlets GET method takes one paramater, ID. The servlet seems to be working, For example,chrome shows my AJAX GET request returning the following when the [Booking]ID paramater sent is 1.

    0: {WidgetID:46, BookingID:1, X:393, Y:50, Content:Test1}
    1: {WidgetID:47, BookingID:1, X:337, Y:251, Content:Test2}
    2: {WidgetID:48, BookingID:1, X:97, Y:198, Content:Test3}

The problem I have is with parsing this response. Here is my JS code:

    loadPositions() {
    var BookingID = 
    if (BookingID != null && BookingID != "null")
    {
    var data = {"id" : BookingID};
    $.getJSON("Widget", data, function(data) {
    // Successfully got all this bookings widgets as JSON, TODO: Parse this!
    });
    }
    } 

What should I put in the “TODO: Parse this!” section?
I want to foreach over all the elements, and grab their data. I really suck at this JQuery stuff.

  • 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-30T12:26:58+00:00Added an answer on May 30, 2026 at 12:26 pm

    In the todo section, you should do the following to loop through all the arrays:

    $.each(data, function(index,value){
        // here index=0 & value.WidgetID=46, value.BookingId = 1, use it as you would like to.
    
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a Java application that I'm writing an installer for. We're using the
I've got a Java web application (using Spring), deployed with Jetty. If I try
So I've got some Java code that uses Jakarta HttpClient like this: URI aURI
I've got a system where some C++ code (using xmlrpc-c) talks to a Java
How to get value of the field in Runtime for Java? EDIT: using this
I've got a java application on a windows machine which pins the CPU from
This one has me stumped. I've got a java.sql.ResultSet and I'm pulling string values
I've got a simple java class that looks something like this: public class Skin
i've got a (probably very simple) problem with jquery. I'm running a Java Servlet
I've got a Java servlet that handles file uploads, but resides in the intranet

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.