ionezation Posted January 14, 2014 Share Posted January 14, 2014 In Chapter 7 - Creating Function page number 237. The code in the book has a discrepency that is provided in source code. It took me 30mins to get on the conclusion. The difference was at line output.textContent = numbers; Instead it would be output.textContent = message; Here it is the code This is in the book at page 237 function setText(elementId,message) { 'use strict'; if ((typeof elementId == 'string') && (typeof message == 'string') ){ var output = $(elementId); if(output.textContent !== undefined) { output.textContent = numbers; } else { output.innerText = numbers; } } // end of if } // end of setText() This is the working corrected one in source code : 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 if } // end of setText() Link to comment Share on other sites More sharing options...
Larry Posted January 15, 2014 Share Posted January 15, 2014 Sorry about the confusion! I'll double-check that this is in the errata. Link to comment Share on other sites More sharing options...
ionezation Posted January 16, 2014 Author Share Posted January 16, 2014 So nice of you larry thanks for providing such great treasure to learn for me .. One thing larry may i ask you for career path? anywhere in this forum??? Link to comment Share on other sites More sharing options...
HartleySan Posted January 16, 2014 Share Posted January 16, 2014 Try the Social board. Link to comment Share on other sites More sharing options...
ionezation Posted January 17, 2014 Author Share Posted January 17, 2014 Thank you Hartleysan ! Link to comment Share on other sites More sharing options...
Recommended Posts