Go to content

Deconstructing A Dynamic Quiz (Part III)

THE JAVASCRIPT (CONTINUED) $(‘#next’).on(‘click’, function(event) { event.preventDefault(); if($(“#quiz”).is(‘:animated’)) { return false; } choose(); if(isNaN(selections[questionCounter])) { alert(‘Please make a selection!’); } else { questionCounter++; displayNext(); } }); A click handler is created for the ‘next’ button. When clicked, a function is ran. The first thing it does is calls the preventDefault() method, which stops the default…

Deconstructing A Dynamic Quiz (Part II)

As mentioned before, the majority of how the quiz is being displayed and ran is written with JavaScript, and with some assistance from jQuery. jQuery is one of many JavaScript libraries, used to help simplify the client-side scripting of HTML. THE JAVASCRIPT (function() { /*!!Dynamic Quiz Goes Here*/ })(); Placing the dynamic quiz into an…

Deconstructing A Dynamic Quiz (Part I)

In an effort to expand my own front-end knowledge of the web, I’ve decided to study up on JavaScript. The good people (person?) over at javascriptissexy.com created a wonderful little guide on how to learn JavaScript properly and I had used my freetime to go through the lessons and required reading material. Unfortunately, what was…