Skip to content

Instantly share code, notes, and snippets.

@annajmorton
Last active July 7, 2016 18:59
Show Gist options
  • Save annajmorton/54e57e8ef5e8954fc4ed9695cac60bff to your computer and use it in GitHub Desktop.
Save annajmorton/54e57e8ef5e8954fc4ed9695cac60bff to your computer and use it in GitHub Desktop.
4.5.1 Class Notes - 6/17

#Class Notes ###Solutions for 4.5.1 Ajax Intro excercises

###Here is some alternative syntax for writing really long strings. The solutions use what is called a template literal:

     var categories = tool.categories.join(' ');
                var row = "<tr>";
                    row += "<td>" + tool.title + "</td>";
                    row += "<td>" + tool.quantity + "</td>";
                    row += "<td>" + tool.price + "</td>";
                    row += "<td>" + categories + "</td>";
                    row += "</tr>";
                $('#insertProducts').append(row);

###have a super hot awesome weekend!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment