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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:52:22+00:00 2026-06-16T02:52:22+00:00

Hello I have a variable with the percentages like this: test = 3%, 7%,

  • 0

Hello I have a variable with the percentages like this:

test = "3%, 7%, 10%, 11%, 50%, 75%, 77%, 82%, 91%, 100%"

It’s a Python/Django variable.

Now, I want to use those numbers to construct a progress bar using Javascript.

I am dumping the variable test as json like:

json.dumps(test)

How do I call it in Javascript and construct the progress bar out of it? Thanks

  • 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-16T02:52:23+00:00Added an answer on June 16, 2026 at 2:52 am

    Do not expect someone to do this kind of work for you, you need to do it yourself. I have provided you with a short example and explanation to help you understand what is going on, the rest is up to you.

    Here is a command line example in Python:

    import sys, time
    print
    
    pers = [3, 7, 10, 11, 50, 75, 77, 82, 91, 100]
    for per in pers:
        sys.stdout.write('\r[%s>%s]' % (
            ('=' * ((per / 2) -1)), ' '*(50-(per/2)))
        )
        sys.stdout.flush()
        time.sleep(0.5)
    
    print
    print 
    

    Do you understand what is happening here? The basic concept is that you add to the progress out of the total. So, here i used time.sleep(0.5) to add random time in so you can actually see the progress, but when you are writing your javascript code, this will be progressing as whatever you need is loading.

    So, once you grasp this idea, simply repeat the same sort of thing in javascript, except instead of adding characters to a string, you are expanding the width of a rectangle or something. And, you want to show progress out of the whole, so you should probably have an identical rectangle already full width directly behind the progress one, showing the total it has left to load. Then format these rectangles with css to make them look nice 🙂

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

Sidebar

Related Questions

I have a variable containing a string like this in Ruby 1.9.3 #HELLO #HELLO
If I have the following variable in PHP: $Message='Hello, this is just test message';
Hello I have like this 2 tables class User public int UserId{get;set;} { ....
first I have two variable: var $prev=<div>This is Hello World</div> var $next=<h1>This is another
If I have a variable $var in this string: echo Hello, there are many
I have a variable: var text = hello; I want to get the 0
Hello everybody I have a LINQ declaration like this : var query = from
Hello i have 2 arrays and and i want to put them in a
hello i have this question i was trying to find a way to call
Hello I have a datatable that I would like to filter with a single

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.