I’m working my way through freeCodeCamp’s front-end projects, but I’m not having any luck with obtaining quotations using the following code; could anyone point me in the right direction?

<!DOCTYPE html>
<html lang="en">

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Random Quotation Generator</title>

    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

    <!-- jQuery library -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

    <!-- Latest compiled JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

        $("#getQuotation").on('click', function () {
            $.getJSON("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&callback=", function (data) {
                $(".message").html(data[0].content + " — " + data[0].title)

    <div class="container">
        <div class="row text-center">
            <h1 class="text-primary">Random Quotation Generator</h1>
            <div class="well col-xs-12 message">
                <h4>Click the button below to get a nice fresh quotation!</h4>
        <div class="col-xs-12 row text-center ">
            <button id="getQuotation" class="btn btn-primary">Gimme a quotation!</button>


Read more here: Can’t get WordPress’ JSON REST API working with JQuery


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: