Khai Posted August 16, 2012 Share Posted August 16, 2012 Hello! I'm loving this book on Javascript. It was given to me and probably the best book I've read on javascript! (I'm still new at it) Although, I seem to be having a problem that I cant seem to figure out. You know the exercies sorting an array with a user defined function? Well in the setText() function I was creating the IF statement for the elementId and message. if( (typeof elementId == 'string') && (typeof message == 'string')){ var output = $(elementId); if(output.textContent !== undefined){ output.textContent = numbers; } else { output.innerText = numbers; } } The problem is that the output.textContent and the innerText that are assigned to numbers doesn't seem to work! The "numbers' don't seem to be assigned to a value. As it says "Unresolved variable or type." This happened in the last exercies I did with the modefied days.js. Any help would be awesome! Thanks Link to comment Share on other sites More sharing options...
Khai Posted August 17, 2012 Author Share Posted August 17, 2012 Never mind, I solved it. I had to change the assignment of the output.innerText to message instead of numbers. Don't understand why It said to assign it to numbers though. Link to comment Share on other sites More sharing options...
Larry Posted August 18, 2012 Share Posted August 18, 2012 Kudos for figuring it out. This was an error on my part, I believe: a late copy and paste that didn't get fixed. It's listed on the errata page, which you can check when you have a true mystery like this. Apologies for the confusion! Link to comment Share on other sites More sharing options...
Recommended Posts