diff --git a/src/assets/main.js b/src/assets/main.js index 25601766..591ce2fc 100644 --- a/src/assets/main.js +++ b/src/assets/main.js @@ -1,5 +1,20 @@ $(function() { - // your code will go here + $.ajax({ + url: 'https://www.codeschool.com/users/yterais.json', + dataType: 'jsonp', + success: function(response) { + allCourses(response.courses.completed); + } + }); + function allCourses(courses) { + var $badges = $('#badges'); + courses.forEach(function(course) { + var $course = $('
', {'class': 'course'}).appendTo($badges); + $('', {text: course.title}).appendTo($course); + $('', {src: course.badge,}).appendTo($course); + $('', {'class': 'btn btn-primary', target: '_blank', href: course.url, text: 'See Course'}).appendTo($course); + }) + } });