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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:55:34+00:00 2026-05-29T06:55:34+00:00

I am using the YUI Progress Bar but I’m having some problems with it.

  • 0

I am using the YUI Progress Bar but I’m having some problems with it.

Normally to change the value of the progress bar, one would use:
progressBar.set('value', 10000);
Where value is the thing I am trying to change and 10000 is what I want to change it to. In the console, this returns true

That works fine. But I want to pass a variable as the value:
progressBar.set('value', total);
But this is not working for me and the console reports false

Here is the code:

This creates and renders the bar:

var progressBar = new YAHOO.widget.ProgressBar({
                direction: "ttd",
                height: "75px",
                width: "750px",
                anim: true,
                minValue: 0,
                maxValue: 85000,
                value: 35000
            }).render("bar");

            var anim = progressBar.get('anim');
            anim.duration = 3;
            anim.method = YAHOO.util.Easing.bounceBoth;

And this is an ajax request to get the value that I would like to set the bar to:

var itemTotal, mITotal, donationTotal, total;

            function showHint()
            {
            var xmlhttp;
            if (window.XMLHttpRequest)
              {// code for IE7+, Firefox, Chrome, Opera, Safari
              xmlhttp=new XMLHttpRequest();
              }
            else
              {// code for IE6, IE5
              xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
              }
            xmlhttp.onreadystatechange=function()
              {
              if (xmlhttp.readyState==4 && xmlhttp.status==200)
                {
                var myString = new String(xmlhttp.responseText); 
                var myArray = myString.split(',');
                itemTotal = myArray[0];
                mITotal = myArray[1];
                donationTotal = myArray[2];
                total = myArray[3];

                progressBar.set('value', total);
                alert(total);
                }
              }
            xmlhttp.open("GET","goal_ajax.php",true);
            xmlhttp.send();
            }

Any ideas?

  • 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-29T06:55:35+00:00Added an answer on May 29, 2026 at 6:55 am

    This:

                    var myArray = myString.split(',');
                    ...
                    total = myArray[3];
    

    doesn’t set total to 10000 (a number), but to '10000' (a string). I’m betting that if you were to try

                    progressBar.set('value', '10000');
    

    you’d see the same problem. To fix this, change this:

                    total = myArray[3];
    

    to this:

                    total = +myArray[3];
    

    which will convert the '10000' into 10000.

    (Disclaimer: not tested. This is just a guess, but as guesses go, I’m pretty confident of it.)

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

Sidebar

Related Questions

I am currently using YUI datatable, but it is buggy: http://developer.yahoo.com/yui/datatable/ Is there another
I am using YUI's datatable ( http://developer.yahoo.com/yui/datatable/ ) to make a table. But notice
Problem in YUI:I am using YUI grid,my dataset contains some special character.i bind my
I'm using YUI 3 CSS Reset on my page, but want to display a
For some reason whenever I do an async request using YUI and specify it
I am using YUI panel for dipslaying some contents on the ui which has
I'm using YUI framework to style my radiobuttons and want to use the oncheckedchanged
So I'm using YUI to add some animations in my application triggered when a
We are using YUI's onclick events, but we create and delete dome nodes rapidly
I am using YUI editor. I tried to fetch the textarea value and save

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.