Simple Concepts

The Quiz examples combine some the concepts presented in the previous Weeks. The Quizzes illustrate that "complex" or "complicated" scripts are just made of many "simple concepts". When the "simple concepts" are combined they produce some very powerful scripts.

Week 5

  • Simple Quiz - concept:
    • if (form[0].checked == true) correct++; a counter (correct++) that gets incremented based on the criterion we set

Week 6

  • Order Form - concept:
    • eval('document.order.t' + dir + num).value = fix(subtotal); the eval allows us to pass variables through the DOM (Document Object Model) string

Week 7

  • Quiz - concepts:
    • eval("form.Q" + i).length; the eval allows us to pass variables through the DOM (Document Object Model) string
    • if (count == eval("a" + i).length) correct++; a counter (correct++) that gets incremented based on the criterion we set
    • if (field.checked && field.value == answers[i - 1][k]) count++; uses Multi-Dimensional Arrays