Sample Code to Get AJAX Calls Working in a Bloopist Post

This is a simple test post to show that jQuery can be used to retrieve JSON data from the Bloopist servers and display it in the current page. The code is contained within an iframe sandbox to ensure it is safe for the end user.

Source Code

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.js"></script>

Title: <div id="title">title not loaded yet...</div><br/>
Author: <div id ="author">author not loaded yet...</div><br/>
Body: <div id="body">body not loaded yet...</div>
<script>
  var url = "https://blog.kurttomlinson.com/posts/3.json";
  $.ajax(url)
  .always(function(data) {
    $("#title").html(data.title);
    $("#author").html(data.author);
    $("#body").html(data.body);
console.log(data.body);
  });
</script>

Results

Title:

title not loaded yet...

Author:
author not loaded yet...

Body:
body not loaded yet...