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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:44:36+00:00 2026-05-24T23:44:36+00:00

I want to create a progressbar that takes data from the server (servlet). So

  • 0

I want to create a progressbar that takes data from the server (servlet).
So i create a html file and a servlet wich create json data(static for test purpose)

  <script>
  $(document).ready(function() {
    $.getJSON("GetProgressEvent", function(data) {     
    $.each(data.ProgressEvents, function(){
    $("#progressbar").progressbar({ value: this.progress });
     $("#progressStatus").html(this.status);
    });
    // setTimeout(arguments.callee, 500);
    });
  });
  </script>
</head>
<body style="font-size:62.5%;">

<div id="progressbar"></div>
<div id ="progressStatus"></div>
</body>
</html>

Servlet GetProgressEvent.java:

 @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException
   {
      resp.setContentType("application/json");
      resp.setCharacterEncoding("utf-8");
      PrintWriter out = resp.getWriter();
      out.println("{'ProgressEvents':[{'progress':"
         + 10
         + ",'status':'10%'},{'progress':"
         + 20
         + ",'status':'20%'},{'progress':"
         + 30
         + ",'status':'30%'}}]}");
      out.close();

   }

with firebug I noticed that the servlet sends the data normally, the data sent lokk like this:

{'ProgressEvents':[{'progress':10,'status':'10%'},{'progress':20,'status':'20%'},{'progress':30,'status':'30%'}}]}

but the problem that the loop is never executed and i dont understand why.
I just started with jQuery and I need your help,any help is apreciated
thank you in advance for the help 🙂

  • 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-24T23:44:36+00:00Added an answer on May 24, 2026 at 11:44 pm

    The problem is that ‘ is not valid json you need double quotes.

    You can validate the json using http://jsonlint.com/

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

Sidebar

Related Questions

I want to create a simple http proxy server that does some very basic
I want to create a function that performs a function passed by parameter on
In my PHP web site, i want to create a file uploading progress bar.
I want to create a table representing data I have, but I want each
Here is the thing, I want to create a simply app that copy many
I want to create a program that does remote installs. I'd like to be
Hello i did my notification of download file from web. Code below. I want
want to create listview with 2 component in every row 1st progressbar and 2nd
I want create a drop shadow around the canvas component in flex. Technically speaking
I want create a excel with Apache POI in java and I must insert

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.