Jump to content
Larry Ullman's Book Forums

Recommended Posts

I went to the JS errata page but it didn't work, the javascript kept loading but didn't submit my comment. So i will post the comment here.


On PG.253 words.js i changed from numbers to message for the script to work. Apart from that this book is awesome, i am just dieing now to be able to get javascript into my webpages.


// Function for setting text of an element:

function setText(elementId, message) {

'use strict';

if ( (typeof elementId == 'string')

&& (typeof message == 'string') ) {

var output = $(elementId);

if (output.textContent !== undefined) {

output.textContent = message;

} else {

output.innerText = message;


} // End of main IF.

} // End of setText() function.

Link to post
Share on other sites
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...