2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								  "name" :  "JSON APIs and Ajax" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								  "order" :  10.5 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								  "time" :  "30m" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								  "challenges" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "id" :  "bb000000000000000000001" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "title" :   "Trigger Click Events with jQuery" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "description" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "In this section, we'll learn how to get data from APIs. APIs - or Application Programming Interfaces - are tools that computers use to communicate with one another." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:46:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "We'll also learn how to update HTML with the data we get from these APIs using a technology called Ajax." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "First, let's review what the <code>$(document).ready()</code> function does. This function makes it so all code inside of it only runs  once our page loads." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Let's make our \"Get Message\" button change the text of the element with the class <code>message</code>." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Before we can do this, we need to implement a <code>click event</code> inside of our <code>$(document).ready()</code> function by adding this code:" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>$(\"#getMessage\").on(\"click\", function(){</code>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>});</code>" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "tests" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:46:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\#getMessage(?:'|\")\\s*?\\)\\s*?\\.on\\s*?\\(\\s*?(?:'|\")click(?:'|\")\\s*?\\,\\s*?function\\s*?\\(\\s*?\\)\\s*?\\{/gi), 'Bind the click event to the button with the ID of <code>getMessage</code>')" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "assert(editor.match(/\\n*?\\s*?\\}\\n*?\\s*?\\);/gi) && editor.match(/\\n*?\\s*?\\}\\);/gi).length >= 2, 'Be sure to close your functions with <code>});</code>')" 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeSeed" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fccss" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  $(document).ready(function() {" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    // Only change code below this line." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    " , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    // Only change code above this line." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  });" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fcces" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<div class=\"container-fluid\">" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <h2>Cat Photo Finder</h2>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12 well message\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      The message will go here" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      <button id = \"getMessage\" class = \"btn btn-primary\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        Get Message" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      </button>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "</div>" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeType" :  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "type" :  "waypoint" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:46:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "id" :  "bc000000000000000000001" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "title" :   "Change Text with Click Events" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "description" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "When our click event happens, we can use Ajax to update an HTML element." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:46:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Let's make it so that when a user clicks the \"Get Message\" button, we change the text of the element with the class <code>message</code> to say \"Here is the message\"." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "We can do this by adding the following code within our click event:" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  $(\".message\").html(\"Here is the message\");</code>" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "tests" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:46:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "assert(editor.match(/\\$\\s*?\\(\\s*?(?:'|\")\\.message(?:'|\")\\s*?\\)\\s*?\\.html\\s*?\\(\\s*?(?:'|\")Here\\sis\\sthe\\smessage(?:'|\")\\s*?\\);/gi), 'Clicking the \"Get Message\" button should give the element with the class <code>message</code> the text \"Here is the message\".')" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeSeed" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fccss" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  $(document).ready(function() {" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    $(\"#getMessage\").on(\"click\", function(){" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      // Only change code below this line." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      " , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      // Only change code above this line." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    });" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  });" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fcces" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<div class=\"container-fluid\">" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <h2>Cat Photo Finder</h2>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12 well message\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      The message will go here" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      <button id = \"getMessage\" class = \"btn btn-primary\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        Get Message" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      </button>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "</div>" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeType" :  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "type" :  "waypoint" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "id" :  "bb000000000000000000002" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "title" :  "Get JSON with the jQuery getJSON Method" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "description" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "You can also request data from an external source. This is where APIs come into play." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Remember that APIs - or Application Programming Interfaces - are tools that computers use to communicate with one another." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Most web APIs transfer data in a format called JSON. JSON stands for JavaScript Object Notation." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "You've already been using JSON whenever you create a JavaScript object. JSON is nothing more than object properties and their current values, sandwiched between a <code>{</code> and a <code>}</code>." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:46:21 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "These properties and their values are often referred to as \"key-value pairs\"." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Let's get the JSON from Free Code Camp's Cat Photo API." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Here's the code you can put in your click event to do this:" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  $.getJSON(\"/json/cats.json\", function(json) {</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>    $(\".message\").html(JSON.stringify(json));</code>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  });</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Once you've added this, click the \"Get Message\" button. Your Ajax function will replace the \"The message will go here\" text with the raw JSON output from the Free Code Camp Cat Photo API." 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "tests" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 22:54:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "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.')" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "assert(editor.match(/\\s*?\\}\\s*?\\)\\s*?\\;/gi), 'You should have at least one closing set of brackets and parenthesis.')" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 22:54:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "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.')" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "assert(editor.match(/\\$\\s*?\\.\\s*?getJSON\\s*?\\(\\s*?(\\\"|\\')\\\/json\\\/cats\\.json(\\\"|\\')\\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.')" 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeSeed" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fccss" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  $(document).ready(function() {" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    $(\"#getMessage\").on(\"click\", function(){" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      // Only change code below this line." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      // Only change code above this line." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    });" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  });" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fcces" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<div class=\"container-fluid\">" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <h2>Cat Photo Finder</h2>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12 well message\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      The message will go here" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      <button id = \"getMessage\" class = \"btn btn-primary\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        Get Message" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      </button>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "</div>" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeType" :  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "type" :  "waypoint" 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:01:56 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "id" :  "bb000000000000000000003" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 15:37:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "title" :   "Convert JSON Data to HTML" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:01:56 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "description" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Now that we're getting data from a JSON API, let's display it in our HTML." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "We can use the <code>.map()</code> method to loop through our data and modify our HTML elements." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "First, let's declare an html variable with <code>var html = \"\";</code>." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Then, let's loop through our JSON, adding more HTML to that variable. When the loop is finished, we'll render it." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Here's the code that does this:" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 15:37:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>json.map(function(val) {</code>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  var keys = Object.keys(val);</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  html += \"<div class = 'cat'>\";</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  keys.map(function(key) {</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>    html += \"<b>\" + key + \"</b>: \" + val[key] + \"<br>\";</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  });</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  html += \"</div><br>\";</code>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 15:37:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>});</code>" 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:01:56 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "tests" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "assert(editor.match(/json\\.map/gi), 'The message box should have something in it.')" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:22:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:01:56 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeSeed" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fccss" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  $(document).ready(function() {" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    $(\"#getMessage\").on(\"click\", function() {" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								        "         $.getJSON(\"/json/cats.json\", function(json) {" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        var html = \"\";" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        // Only change code below this line." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        " , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        // Only change code above this line." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								        "             $(\".message\").html(html);" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								        "         });" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    });" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  });" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:01:56 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fcces" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<div class=\"container-fluid\">" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <h2>Cat Photo Finder</h2>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12 well message\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      The message will go here" , "   </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      <button id = \"getMessage\" class = \"btn btn-primary\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        Get Message" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      </button>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:01:56 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "</div>" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeType" :  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "type" :  "waypoint" 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:23:58 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    { 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "id" :  "bb000000000000000000004" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "title" :   "Render Images from Data Sources" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "description" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:22:02 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "In the JSON that we receive data from Free Code Camp's Cat Photo API." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "We've seen from the last two lessons that each object in our JSON array contains an <code>imageLink</code> key with a value that is the url of a cat's image." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "When we're looping through these objects, let's use this <code>imageLink</code> property to display this image in an <code>img</code> element." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Here's the code that does this:" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  html += \"<img src = '\" + val.imageLink + \"'>\";</code>" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "tests" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "assert(editor.match(/val.imageLink/gi), 'You should have used the <code>imageLink</code> property to display the images.')" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeSeed" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fccss" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  $(document).ready(function() {" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    $(\"#getMessage\").on(\"click\", function() {" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								        "        $.getJSON(\"/json/cats.json\", function(json) {" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        var html = \"\";" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        json.map(function(val) {" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "          html += \"<div class = 'cat'>\";" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "          // Only change code below this line." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "          " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "          " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "          " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "          // Only change code above this line." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "          html += \"</div>\";" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        });" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								        "             $(\".message\").html(html);" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      });" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    });" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  });" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fcces" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<div class=\"container-fluid\">" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <h2>Cat Photo Finder</h2>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12 well message\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      The message will go here" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      <button id = \"getMessage\" class = \"btn btn-primary\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        Get Message" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      </button>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "</div>" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeType" :  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "type" :  "waypoint" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "id" :  "bb000000000000000000005" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "title" :   "Prefilter JSON" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:23:58 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "description" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "If we don't want to render every cat photo we get from our Free Code Camp's Cat Photo JSON API, we can pre-filter the json before we loop through it." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Let's filter out the cat who's \"id\" key has a value of 1." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Here's the code to do this:" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 15:37:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>json = json.filter(function(val) {</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  return(val.id !== 1);</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>});</code>" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "tests" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 22:54:20 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "assert(editor.match(/filter/gi), 'You should be making use of the .filter method.')" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeSeed" :  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fccss" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  $(document).ready(function() {" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    $(\"#getMessage\").on(\"click\", function() {" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								        "         $.getJSON(\"/json/cats.json\", function(json) {" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        var html = \"\";" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 14:34:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        // Only change code below this line." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        " , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 14:34:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        // Only change code above this line." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 14:34:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        json.map(function(val){" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "          html += \"<div class = 'cat'>\"" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "          html += \"<img src = '\" + val.imageLink + \"'>\"" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "          html += \"</div>\"" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        });" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 21:32:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								        "             $(\".message\").html(html);" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
										 
									
								 
							
							
								        "         });" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    });" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  });" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fcces" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<div class=\"container-fluid\">" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <h2>Cat Photo Finder</h2>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12 well message\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      The message will go here" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <div class = \"row text-center\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    <div class = \"col-xs-12\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      <button id = \"getMessage\" class = \"btn btn-primary\">" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "        Get Message" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "      </button>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "    </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  </div>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "</div>" 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:23:58 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeType" :  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "type" :  "waypoint" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "id" :  "bb000000000000000000006" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 15:37:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "title" :   "Get Geo-location Data" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "description" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Another cool thing we can do is access our user's current location. Every browser has a built in navigator that can give us this information." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "The navigator will get our user's current longitude and latitude." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-30 19:13:31 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "You will see a prompt to allow or block this site from knowing your current location. The challenge can be completed either way, as long as the code is correct." , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "By selecting allow you will see the text on the output phone change to your latitude and longitude" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "Here's some code that does this:" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 15:37:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>if (navigator.geolocation) {</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  navigator.geolocation.getCurrentPosition(function(position) {</code>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 11:01:35 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>    $(\"#data\").html(\"latitude: \" + position.coords.latitude + \"<br>longitude: \" + position.coords.longitude);</code>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 15:37:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>  });</code>" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<code>}</code>" 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-03 23:59:54 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:23:58 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "tests" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-06 15:37:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "assert(editor.match(/navigator\\.geolocation\\.getCurrentPosition/gi), 'You should make use of the <code>navigator.geolocation</code> to access the users current location.')" 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:23:58 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeSeed" :  [ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-05 23:42:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fccss" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  // Only change code below this line." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-29 21:51:35 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  " , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  // Only change code above this line." , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-05 23:42:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "fcces" , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "<div id = \"data\">" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-23 16:19:00 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  <h4>You are here:</h4>" , 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-05 23:42:30 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "  " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								        "</div>" 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-30 23:23:58 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
								
									
								 
							
							
								      ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "challengeType" :  0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								      "type" :  "waypoint" 
							 
						 
					
						
							
								
									
										
										
										
											2015-09-28 23:24:42 +01:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								    } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								  ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
								
									
								 
							
							
								}