Max Posted April 10, 2012 Share Posted April 10, 2012 Hi Larry I was terribly confused when working through 'tasks.js' which I downloaded from your web site until I realized that 'tasks.html' was calling 'tasks2.js'......Am I missing something here as 'tasks.js' has the following code which doesn't seem to do anything but seems useful:... // Update the page: message = 'You have ' + tasks.length + ' task(s) in your to-do list.'; if (output.textContent !== undefined) { output.textContent = numbers; } else { output.innerText = numbers; } P.S. The book is fantastic! Link to comment Share on other sites More sharing options...
sonal Posted April 10, 2012 Share Posted April 10, 2012 Replace assignment to output to "message" (where it is "number"). output.textContent = message; } else { output.innerText =message; } "tasks.length " stores number of tasks entered so far. It is then updated in "message" variable. And the "message" variable's value is printed through this conditional. 1 Link to comment Share on other sites More sharing options...
Larry Posted April 11, 2012 Share Posted April 11, 2012 Thanks for the nice words on the book and sorry for the confusion. tasks.html includes tasks2.js because there are two versions of that JavaScript file, both used by the same HTML. And as sonal pointed out, there's an error in that code (also listed on the errata page). Link to comment Share on other sites More sharing options...
Recommended Posts