everydayhero: Developer

Page totals

Individual page total

Using the pages endpoint with a .jsonp and callback option you can include a page total on a website.

Below shows a demo JQuery snippet that will load the page total on to a page.

  <script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type='text/javascript'>

  $(function() {
    $.getJSON('https://everydayhero.com/api/v2/pages/123.jsonp?callback=?', {},  function (data) {          
      var funds = data.page.amount;
      $('#raised').html(funds.currency.symbol + (funds.cents / 100) + " raised");
    })  
  });  

</script>

<div id='raised'></div>

Will display

$1234 raised