Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter diveman1

    (@diveman1)

    Thanks, I appreciate the advice. I found the following JSON code for another URL API, and I’m wondering if I can just modify this to meet my needs. The only thing I’m not sure about though is how to feed the parameters to the API and how to handle the output it provides. Here’s what I found. Let me know what you think.

    <script>
    <div class=”result”></div>
    <script type=”text/javascript”>
    window.onload = function() {
    jQuery.ajax({
    url: “http://api.bitcoincharts.com/v1/markets.json&#8221;,
    type: “json”
    }).done(function( data ) {
    var data = JSON.parse(data);
    success: function( json ) {
    $.each(json, function(i, optionHtml){
    $(‘data’).append(optionHtml);
    });
    });
    }
    function repeatMe(){
    $.ajax({
    url: ‘url’,
    dataType: ‘json’,
    cache: true,
    timeout: 30000,
    success: function(data) {
    $(‘#output ul’).empty();
    $.each(data.posts, function(i,data){
    $(‘#output ul’).append(‘

    • <img class=”thumb”
      src=”‘+data.image+'” alt=”” />
      <h3>’+data.title+'</h3><p>’+data.text+'</p>
    • ‘);
      setTimeout(repeatMe, 5000);
      });
      },
      error: function(){
      $(‘#output ul’).append(‘

    • Error’);
      setTimeout(repeatMe, 5000);
      }
      });
      }<
      /script>
    • Hope this helps. Thanks again for the assistance. Please let me know if you have any questions.

    Thread Starter diveman1

    (@diveman1)

    Hi Ross, Thanks so much for the quick response and the very useful information. I’ll definitely be using a child theme for the site. The other part of the question is how do I implement (code) the URL API to display the various product information from the main ordering site? I know I need to use JSON, but the details on the API have been sparse at best. I know I need to send the authentication token along with the input parameters, but I’m not sure how to do this. Once this occurs, the API should return the output (text/base64 image). I’m not sure how to code it so the output list displays in columns and rows on the web page. Sorry, I know this is probably a real noob question, I just can’t seem to figure out how to code it. I’ve Googled my brains out and still no luck. Thanks again for your help and if you have any other advice, or can point me to any other resources, I truly appreciate it. Best wishes.

Viewing 2 replies - 1 through 2 (of 2 total)