Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: codeschool-projects/jQueryBadgesProject
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: cgamache808/jQueryBadgesProject
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 5, 2017

  1. complete tasks for badges

    needed help watched video tho
    cgamache808 committed Mar 5, 2017
    Copy the full SHA
    19201a7 View commit details
Showing with 31 additions and 1 deletion.
  1. +31 −1 src/assets/main.js
32 changes: 31 additions & 1 deletion src/assets/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
$(function() {
$.ajax({
url: 'https://www.codeschool.com/users/cgamache808.json',
dataType: 'jsonp',
success: function(response) {
addCourses(response.courses.completed);
}
});
function addCourses(courses) {
var $badges = $('#badges');

// your code will go here
courses.forEach(function(course){
var $course = $('<div />', {
'class': 'course'
}).appendTo($badges);

$('<h3 />', {
text: course.title
}).appendTo($course);

$('<img />', {
src: course.badge
}).appendTo($course);

$('<a />',{
'class': 'btn btn-primary',
target: '_blank',
href: course.url,
text: 'See Course'
}).appendTo($course);
})

}

});