Three complete. More to come
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
"order": 0.0065,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bad87fed1348bd9aeca08826",
|
||||
"id": "bb000000000000000000000",
|
||||
"title": "Trigger on click Events with jQuery",
|
||||
"difficulty": 3.19,
|
||||
"description": [
|
||||
@ -53,15 +53,14 @@
|
||||
"type": "waypoint"
|
||||
},
|
||||
{
|
||||
"id": "bad87fee1348bd9aebc08826",
|
||||
"title": "Get Data from an URL Using jQuery",
|
||||
"dashedName": "waypoint-get-data-from-a-url-using-jquery",
|
||||
"difficulty": 3.21,
|
||||
"id": "bb000000000000000000001",
|
||||
"title": "Creating HTML from Data from an AJAX request Using jQuery",
|
||||
"difficulty": 3.20,
|
||||
"description": [
|
||||
"",
|
||||
"We are now going to request data from an external source. (a file on FCC for the purposes of this exercise) The request will load in the data an run the code in the function we provide the data to which is known as the callback.",
|
||||
"<code>$(\"#getMessage\").on(\"click\", function() {",
|
||||
"  $.getJSON(\"/json/cats.json?callback=?\", function( json ) {",
|
||||
"  $.getJSON(\"/json/cats.json?callback=\", function( json ) {",
|
||||
"    //Code to run when request is complete",
|
||||
"    $(\".message\").html(JSON.stringify(json))",
|
||||
"  });",
|
||||
@ -73,7 +72,7 @@
|
||||
"assert(editor.match(/\\$\\s*?\\(\\s*?(\\\"|\\')\\#getMessage(\\\"|\\')\\s*?\\)\\s*?\\.\\s*?on\\s*?\\(\\s*?(\\\"|\\')click(\\\"|\\')\\s*?\\,\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/gi), 'You should have a click handler on the getMessage button to trigger the AJAX request')",
|
||||
"assert(editor.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi), 'You should have at least on closing set of brackets and parenthesis')",
|
||||
"assert(editor.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi) && editor.match(/\\,\\s*?function\\s*?\\(\\s*?\\w*?\\s*?\\)\\s*?\\{/gi) && editor.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi).length === editor.match(/\\s*?function\\s*?\\(\\s*?\\w*?\\s*?\\)\\s*?\\{/gi).length, 'Each callback function should have a closing set of brackets and parenthesis')",
|
||||
"assert(editor.match(/\\$\\s*?\\.\\s*?getJSON\\s*?\\(\\s*?\"\\\/json\\\/cats\\.json\\?callback\\=\\?\"\\s*?\\,\\s*?function\\s*?\\(\\s*?json\\s*?\\)\\s*?\\{/gi), 'You should be making use of the getJSON method given in the description to load data from the json file')",
|
||||
"assert(editor.match(/\\$\\s*?\\.\\s*?getJSON\\s*?\\(\\s*?\"\\\/json\\\/cats\\.json\\?callback\\=\"\\s*?\\,\\s*?function\\s*?\\(\\s*?json\\s*?\\)\\s*?\\{/gi), 'You should be making use of the getJSON method given in the description to load data from the json file')",
|
||||
"assert(editor.match(/\\$\\s*?\\(\\s*?\\\"\\.message\\\"\\s*?\\)\\s*?\\.\\s*?html\\s*?\\(\\s*?JSON\\s*?\\.\\s*?stringify\\s*?\\(\\s*?json\\s*?\\)\\s*?\\)/gi), 'Don\\'t forget to make the <code>.html</code> change the contents of the message box so that it contains the result of the getJSON')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
@ -111,6 +110,80 @@
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
{
|
||||
"id": "bb000000000000000000002",
|
||||
"title": "Convert json data to html",
|
||||
"difficulty": 3.21,
|
||||
"description": [
|
||||
"",
|
||||
"Now that we have the data let's re-arrange it so that ",
|
||||
"",
|
||||
"<code>",
|
||||
"  json.map(function(val){",
|
||||
"    ",
|
||||
"    html = html + \"<div class = 'cat'>\"",
|
||||
"    ",
|
||||
"    for(var key in val){",
|
||||
"      html = html + '<div class = \"' + key + '\">' + val[key] + '</div>';",
|
||||
"  }",
|
||||
"    ",
|
||||
"    html = html + \"</div><br/>\"",
|
||||
"    ",
|
||||
"  });",
|
||||
"</code>",
|
||||
""
|
||||
],
|
||||
"tests": [
|
||||
"assert($(\".message\").html() !== '', 'The message box should have something in it')",
|
||||
"assert($(\".message div\").html() !== undefined, 'you should have made created some sort of view from the json data')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
" ",
|
||||
" $(\"#getMessage\").on(\"click\", function() {",
|
||||
" $.getJSON(\"/json/cats.json?callback=\", function( json ) {",
|
||||
" ",
|
||||
" var html = \"\";",
|
||||
" ",
|
||||
" //Add you code to modify the data here. It should add it to the html sting for use in the view",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" //Don't modify above here",
|
||||
" ",
|
||||
" $(\".message\").html(html);",
|
||||
" ",
|
||||
" });",
|
||||
" });",
|
||||
" ",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<!-- You shouldn't need to modify code below this line -->",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class = \"row text-center\">",
|
||||
" <h2>Cat Photo Finder</h2>",
|
||||
" </div>",
|
||||
" <br/>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12 well Message\">",
|
||||
" The message will go here"," </div>",
|
||||
" </div>",
|
||||
" <br/>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12\">",
|
||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||
" Get Message",
|
||||
" </button>",
|
||||
" </div>",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,535 +0,0 @@
|
||||
{
|
||||
"name": "JSON APIs and Ajax",
|
||||
"order": 0.0065,
|
||||
"challenges": [
|
||||
{
|
||||
"id": "bad87fed1348bd9aeca08826",
|
||||
"title": "Trigger on click Events with jQuery",
|
||||
"difficulty": 3.19,
|
||||
"description": [
|
||||
"With jQuery we are able to get data from APIs via Ajax",
|
||||
"This data normally comes in the form of JSON",
|
||||
"Let's get the <code>Get Message</code> button to set the text of a div",
|
||||
"We will later use this to display the result of out API request",
|
||||
"<code>$(\"#getMessage\").on(\"click\", function(){</code>",
|
||||
"<code>  $(\".message\").html(\"Here is the message\");</code>",
|
||||
"<code>});</code>"
|
||||
],
|
||||
"tests": [
|
||||
"assert(editor.match(/\\$\\(\\s?\\\"\\#getMessage\\\"\\s?\\)\\.on\\s?\\(\\s?\\\"click\\\"\\,\\s?function\\s?\\(\\)\\s?\\{/gi), 'You should have bound the click event to the getMessage button')",
|
||||
"assert(editor.match(/\\$\\(\\s?\\\"\\.message\\\"\\s?\\)\\.html\\(\\s?\\\"Here\\sis\\sthe\\smessage\\\"\\s?\\);/gi), 'You should set te value of the #message box to be the message given in the description')",
|
||||
"assert(editor.match(/\\}\\);/gi) && editor.match(/\\}\\);/gi).length >= 2, 'Make sure that you close off all of your functions')"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
" ",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<!-- You shouldn't need to modify code below this line -->",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class = \"row text-center\">",
|
||||
" <h2>Cat Photo Finder</h2>",
|
||||
" </div>",
|
||||
" <br/>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12 well Message\">",
|
||||
" The message will go here",
|
||||
" </div>",
|
||||
" </div>",
|
||||
" <br/>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12\">",
|
||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||
" Get Message",
|
||||
" </button>",
|
||||
" </div>",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
{
|
||||
"id": "bad87fee1348bd9aebc08726",
|
||||
"title": "Learn JSON Syntax",
|
||||
"description": [
|
||||
"JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.",
|
||||
"JSON is a series of \"key-value pairs\". Everything on the left of the colon (<code>:</code>) is the \"key\" you use to unlock the \"value\" on the right of the colon."
|
||||
],
|
||||
"tests": [
|
||||
"assert(typeof data != \"undefined\", \"Whoops! It looks like you deleted the <code>data</code> variable!\");",
|
||||
"assert(typeof getAnId != \"undefined\", \"Whoops! It looks like you deleted the <code>getAnId</code> function!\");",
|
||||
"assert(data[0]['id'] === getAnId(), \"The duntion getFirstId should return the id of the first element in the array\");"
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
"var data = [",
|
||||
" {",
|
||||
" \"id\": 0,",
|
||||
" \"imageLink\": \"http://rs611.pbsrc.com/albums/tt194/allypopper423/Funny-Cat-Green-Avacado.jpg~c200\",",
|
||||
" \"codeNames\": [",
|
||||
" \"Juggernaut\",",
|
||||
" \"Mrs. Wallace\",",
|
||||
" \"Buttercup\"",
|
||||
" ]",
|
||||
" },",
|
||||
" {",
|
||||
" \"id\": 1,",
|
||||
" \"imageLink\": \"http://cdn.grumpycats.com/wp-content/uploads/2012/09/GC-Gravatar-copy.png\",",
|
||||
" \"codeNames\": [",
|
||||
" \"Oscar\",",
|
||||
" \"Scrooge\",",
|
||||
" \"Tyrion\"",
|
||||
" ]",
|
||||
" },",
|
||||
" {",
|
||||
" \"id\": 2,",
|
||||
" \"imageLink\": \"http://www.kittenspet.com/wp-content/uploads/2012/08/cat_with_funny_face_3-200x200.jpg\",",
|
||||
" \"codeNames\": [",
|
||||
" \"The Doctor\",",
|
||||
" \"Loki\",",
|
||||
" \"Joker\"",
|
||||
" ]",
|
||||
" }",
|
||||
"]",
|
||||
"function getAnId(){",
|
||||
" return();",
|
||||
"}",
|
||||
"fcces"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
{
|
||||
"id": "bad87fee1348bd9aeca08826",
|
||||
"title": "Displaying JSON data in HTML",
|
||||
"difficulty": 3.19,
|
||||
"description": [
|
||||
"JSON stands for \"JavaScript Object Notation\". It\"s how you create objects in JavaScript.",
|
||||
"JSON is a series of \"key-value pairs\". Everything on the left of the colon (<code>:</code>) is the \"key\" you use to unlock the \"value\" on the right of the colon."
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
" $(\"#getMessage\").on(\"click\", function(){",
|
||||
" $(\".message\").html(\"Here is the message\");",
|
||||
" });",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<!-- You shouldn't need to modify code below this line -->",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class = \"row text-center\">",
|
||||
" <h2>Cat Photo Finder</h2>",
|
||||
" </div>",
|
||||
" <br/>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12 well Message\">",
|
||||
" The message will go here",
|
||||
" </div>",
|
||||
" </div>",
|
||||
" <br/>",
|
||||
" <div class = \"row text-center\">",
|
||||
" <div class = \"col-xs-12\">",
|
||||
" <button id = \"getMessage\" class = \"btn btn-primary\">",
|
||||
" Get Message",
|
||||
" </button>",
|
||||
" </div>",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad84fee1348bd9aecc48826",
|
||||
"title": "Read Data from an Element Using jQuery",
|
||||
"dashedName": "waypoint-read-data-from-an-element-using-jquery",
|
||||
"difficulty": 3.17,
|
||||
"description": [
|
||||
"Let's make everything roll with <code>rollOut</code>."
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
" $(\"button\").on(\"click\", function() {",
|
||||
" $(\"#click-me\").addClass(\"animated shake\");",
|
||||
" });",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<!-- You shouldn't need to modify code below this line -->",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class=\"row\">",
|
||||
" <div class=\"col-xs-2\">",
|
||||
" <input type=\"checkbox\" id=\"check-me\">",
|
||||
" </div>",
|
||||
" <div class=\"col-xs-10\">",
|
||||
" <p>#check-me</p>",
|
||||
" </div>",
|
||||
" <button class=\"btn btn-block btn-primary\">#click-me</button>",
|
||||
" <span>Is the checkbox checked?</span>",
|
||||
" <span id=\"checked-state\"></span>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad84fee1348bd9aecc38826",
|
||||
"title": "Read Data from an Element Using jQuery",
|
||||
"dashedName": "waypoint-read-data-from-an-element-using-jquery",
|
||||
"difficulty": 3.17,
|
||||
"description": [
|
||||
"Let's make everything roll with <code>rollOut</code>."
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
" $(\"button\").on(\"click\", function() {",
|
||||
" $(\"#click-me\").addClass(\"animated shake\");",
|
||||
" $(\"#checked-state\").text(\"happy text\");",
|
||||
" });",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<!-- You shouldn't need to modify code below this line -->",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class=\"row\">",
|
||||
" <div class=\"col-xs-2\">",
|
||||
" <input type=\"checkbox\" id=\"check-me\">",
|
||||
" </div>",
|
||||
" <div class=\"col-xs-10\">",
|
||||
" <p>#check-me</p>",
|
||||
" </div>",
|
||||
" <button class=\"btn btn-block btn-primary\">#click-me</button>",
|
||||
" <span>Is the checkbox checked?</span>",
|
||||
" <span id=\"checked-state\"></span>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad84fee1348bd9aecc28826",
|
||||
"title": "Read Data from an Element Using jQuery",
|
||||
"dashedName": "waypoint-read-data-from-an-element-using-jquery",
|
||||
"difficulty": 3.17,
|
||||
"description": [
|
||||
"Let's make everything roll with <code>rollOut</code>."
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
" $(\"button\").on(\"click\", function() {",
|
||||
" $(\"#click-me\").addClass(\"animated shake\");",
|
||||
" $(\"#checked-state\").text($(\"#check-me\").prop(\"checked\"));",
|
||||
" });",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<!-- You shouldn't need to modify code below this line -->",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class=\"row\">",
|
||||
" <div class=\"col-xs-2\">",
|
||||
" <input type=\"checkbox\" id=\"check-me\">",
|
||||
" </div>",
|
||||
" <div class=\"col-xs-10\">",
|
||||
" <p>#check-me</p>",
|
||||
" </div>",
|
||||
" <button class=\"btn btn-block btn-primary\">#click-me</button>",
|
||||
" <span>Is the checkbox checked?</span>",
|
||||
" <span id=\"checked-state\"></span>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad84fee1348bd9aecc18826",
|
||||
"title": "Read Data from an Element Using jQuery",
|
||||
"dashedName": "waypoint-read-data-from-an-element-using-jquery",
|
||||
"difficulty": 3.17,
|
||||
"description": [
|
||||
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" $(document).ready(function() {",
|
||||
" $(\"button\").on(\"click\", function() {",
|
||||
" $(\"#click-me\").addClass(\"animated shake\");",
|
||||
" $(\"#checked-state\").text($(\"#check-me\").prop(\"checked\"));",
|
||||
" });",
|
||||
" });",
|
||||
"fcces",
|
||||
"",
|
||||
"<!-- You shouldn't need to modify code below this line -->",
|
||||
"",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <div class=\"row\">",
|
||||
" <div class=\"col-xs-2\">",
|
||||
" <input type=\"checkbox\" id=\"check-me\">",
|
||||
" </div>",
|
||||
" <div class=\"col-xs-10\">",
|
||||
" <p>#check-me</p>",
|
||||
" </div>",
|
||||
" <button class=\"btn btn-block btn-primary\">#click-me</button>",
|
||||
" <span>Is the checkbox checked?</span>",
|
||||
" <span id=\"checked-state\"></span>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad87fee1348bd9aecc08826",
|
||||
"title": "Trigger onHover Events with jQuery",
|
||||
"dashedName": "waypoint-trigger-onhover-events-with-jquery",
|
||||
"difficulty": 3.18,
|
||||
"description": [
|
||||
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad87fee1348bd9aebc08826",
|
||||
"title": "Get Data from an URL Using jQuery",
|
||||
"dashedName": "waypoint-get-data-from-a-url-using-jquery",
|
||||
"difficulty": 3.21,
|
||||
"description": [
|
||||
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
"",
|
||||
" $(document).ready(function() {",
|
||||
"",
|
||||
" $(\"#cat-button\").on(\"click\", function() {",
|
||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
||||
"",
|
||||
" });",
|
||||
" });",
|
||||
"",
|
||||
" });",
|
||||
"fcces",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
||||
" <div class=\"jumbotron\" id=\"output\">",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad87fee1348bd9ae9c08826",
|
||||
"title": "Loop through JSON Data Using jQuery",
|
||||
"dashedName": "waypoint-loop-through-json-data-using-jquery",
|
||||
"difficulty": 3.22,
|
||||
"description": [
|
||||
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
"",
|
||||
" $(document).ready(function() {",
|
||||
"",
|
||||
" $(\"#cat-button\").on(\"click\", function() {",
|
||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
||||
"",
|
||||
" });",
|
||||
" });",
|
||||
"",
|
||||
" });",
|
||||
"fcces",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
||||
" <div class=\"jumbotron\" id=\"output\">",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad88fee1348bd9ae8c08726",
|
||||
"title": "Wire AJAX Call into a jQuery Click Event",
|
||||
"dashedName": "waypoint-wire-ajax-call-into-a-jquery-click-event",
|
||||
"difficulty": 3.24,
|
||||
"description": [
|
||||
"<img src=\"https://www.evernote.com/l/AjmAQ5BxGrFGRrWl_j2eSpGZMfrunfse89gB/image.png\">"
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" var random = function() { return Math.floor(Math.random() * 3) }",
|
||||
" $(document).ready(function() {",
|
||||
"",
|
||||
" $(\"#cat-button\").on(\"click\", function() {",
|
||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
||||
"",
|
||||
" });",
|
||||
" });",
|
||||
"",
|
||||
" });",
|
||||
"fcces",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
||||
" <div class=\"jumbotron\" id=\"output\">",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad88fee1348bd9ae8c08626",
|
||||
"title": "Wire AJAX Call into a jQuery Click Event",
|
||||
"dashedName": "waypoint-wire-ajax-call-into-a-jquery-click-event",
|
||||
"difficulty": 3.24,
|
||||
"description": [
|
||||
"<img src=\"https://www.evernote.com/l/AjmAQ5BxGrFGRrWl_j2eSpGZMfrunfse89gB/image.png\">"
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" var random = function() { return Math.floor(Math.random() * 3) }",
|
||||
" $(document).ready(function() {",
|
||||
"",
|
||||
" $(\"#cat-button\").on(\"click\", function() {",
|
||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
||||
" var kitten = json[random()];",
|
||||
" });",
|
||||
" });",
|
||||
"",
|
||||
" });",
|
||||
"fcces",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
||||
" <div class=\"jumbotron\" id=\"output\">",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad88fee1348bd9ae8c08526",
|
||||
"title": "Wire AJAX Call into a jQuery Click Event",
|
||||
"dashedName": "waypoint-wire-ajax-call-into-a-jquery-click-event",
|
||||
"difficulty": 3.24,
|
||||
"description": [
|
||||
"<img src=\"https://www.evernote.com/l/AjmAQ5BxGrFGRrWl_j2eSpGZMfrunfse89gB/image.png\">"
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" var random = function() { return Math.floor(Math.random() * 3) }",
|
||||
" $(document).ready(function() {",
|
||||
"",
|
||||
" $(\"#cat-button\").on(\"click\", function() {",
|
||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
||||
" var kitten = json[random()];",
|
||||
" $(\"<img src=\"\" + kitten.imageLink + \"\">\").appendTo(\"#output\");",
|
||||
" });",
|
||||
" });",
|
||||
"",
|
||||
" });",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
||||
" <div class=\"jumbotron\" id=\"output\">",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
},
|
||||
|
||||
{
|
||||
"id": "bad88fee1348bd9ae8c08426",
|
||||
"title": "Wire AJAX Call into a jQuery Click Event",
|
||||
"dashedName": "waypoint-wire-ajax-call-into-a-jquery-click-event",
|
||||
"difficulty": 3.24,
|
||||
"description": [
|
||||
"<img src=\"https://www.evernote.com/l/AjmAQ5BxGrFGRrWl_j2eSpGZMfrunfse89gB/image.png\">"
|
||||
],
|
||||
"tests": [
|
||||
|
||||
],
|
||||
"challengeSeed": [
|
||||
"fccss",
|
||||
" var random = function() { return Math.floor(Math.random() * 3) }",
|
||||
" $(document).ready(function() {",
|
||||
"",
|
||||
" $(\"#cat-button\").on(\"click\", function() {",
|
||||
" $.getJSON(\"/json/cats.json\", function( json ) {",
|
||||
" var kitten = json[random()];",
|
||||
" $(\"<img src=\"\" + kitten.imageLink + \"\">\").appendTo(\"#output\");",
|
||||
" $(\"<h3>Code name: \" + kitten.codeNames[random()] + \"</h3>\").appendTo(\"#output\");",
|
||||
" });",
|
||||
" });",
|
||||
"",
|
||||
" });",
|
||||
"fcces",
|
||||
"<div class=\"container-fluid\">",
|
||||
" <button id=\"cat-button\" class=\"btn btn-primary btn-block btn-lg\">#cat-button</button>",
|
||||
" <div class=\"jumbotron\" id=\"output\">",
|
||||
" </div>",
|
||||
"</div>"
|
||||
],
|
||||
"challengeType": 0,
|
||||
"type": "waypoint"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user