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

The Archive Base Latest Questions

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

<!DOCTYPE html> <html> <head> <link rel=stylesheet type=text/css href=styles/common.css> <script src=http://code.jquery.com/jquery-latest.min.js></script> <script type=’text/javascript’> $(function() {

  • 0
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="styles/common.css">

    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script type='text/javascript'>
$(function() { 
     $.getJSON('http://api.jo.je/justgiving/jsonp.php?d=expedition-aconcagua&callback=?', {},  function (data) {           
            $('#title').html(data.title);          
            $('#target').html(data.donations_target);           
            $('#raised').html(data.donations_total);          
            $('#percent').html(data.percentage_complete);    
            $('#charity').html(data.charity);    
            $('#charity_details').html(data.charity_details);    
            $('#charity_logo').html(data.charity_logo);
            var donations = "";
            $.each(data.donations, function(index, value) {                         
                    if (index < 3)
                    {
                            donations  = donations + "<strong>" + value.person + "</strong>" + value.amount + "<br />" + value.message + "<br />";
                    }
            });             
            $('#donations').html(donations);

            var cssjson = {
                ".percentage_bar_complete":{
                "width":"data.percentage_complete"
                }
            }

            var styleStr = "";
            for(var i in cssjson){ styleStr += i + " {\n"
            for(var j in cssjson[i]){
            styleStr += "\t" + j + ":" + cssjson[i][j] + ";\n"     
            }
            styleStr += "}\n"  
            }
       })  
});  

    </script>

</head>
<body>
    <h2><span id='title'></span></h2>
    <h3><span id='charity'></span></h2>
    <div><img src="<span id='charity_logo'></span>" /><span id='charity_logo'></span></div>
    <h3>Target <span id='target'></span>, <span id='raised'></span> raised</h3>

    <h4>Percentage Complete - <span id='percent'></span>%</h4>
    <div class="percentage_bar">
        <div class="baseline">
            <p>0%</p>
        </div>
        <div class="total">
            <p>100%</p>
        </div>
        <br clear="all" />
        <div class="percentage_bar_bg">
            <div class="percentage_bar_complete">
            </div>
        </div>
    </div>

    <h3>Most recent donations</h3>

    <div id='donations'></div>

I am having difficulty getting the CSS part of the JSON to work. The intention is to have two div layers one top of the other, the bottom with a width of 100% to indicate the empty bar and the other with a percent width drawn from the JustGiving JSON feed “percentage_complete”.

However the CSSJSON code I have added does not seem to working. Any help would be greatly appreciated.

The page as it is can be viewed here http://www.adam-poole.co.uk/test/jg.html

  • 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-25T23:24:13+00:00Added an answer on May 25, 2026 at 11:24 pm
    var cssjson = {
      ".percentage_bar_complete":{
         "width":"data.percentage_complete"
      }
    }
    

    you are setting the width property to the value of (string) "data.percentage_complete" instead of the value of the variable data.percentage_complete. remove the double quotation marks around the variable name.

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

Sidebar

Related Questions

I have the following code: <!DOCTYPE html> <html> <head> <link rel=stylesheet type=text/css media=screen href=jquery-ui-1.8.9.custom.css
<!DOCTYPE html> <html> <head> <meta charset=utf-8 /> <title>Remote Control</title> </head> <link rel=stylesheet href=/../.. type=text/css
Consider the following markup: <!DOCTYPE html> <html> <head> <title>Test Page</title> <link href=screen.css rel=stylesheet />
See example: <!DOCTYPE html> <html> <head> <title>language</title> <script type=text/javascript src=http://www.google.com/jsapi> </script> </head> <body> <div
<!DOCTYPE html> <html lang=en> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js type=text/javascript></script> <script type=text/javascript>
this is the first page : index.html <!DOCTYPE html> <html> <head> <link rel=stylesheet href=../test/style.css>
<!DOCTYPE html> <html> <head> <title>Site :: </title> <link rel=stylesheet media=screen href=css/wicahost.css /> <link rel=stylesheet
If I have the following HTML: <!DOCTYPE html> <html> <head> <title>Test</title> <link href=base.css rel=stylesheet/>
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Frameset//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd> <html> <head> <script type=text/javascript> function selectSomething(){
<!DOCTYPE html> <html> <head> <meta name=viewport content=width=device-width, initial-scale=1> <link rel=stylesheet href=http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css /> <script src=http://code.jquery.com/jquery-1.6.4.min.js></script>

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.