sonal Posted June 27, 2012 Share Posted June 27, 2012 As I read Larry's book, Modern JavaScript, I know it is no good to use document.writeln method to print any data in the browser. Now, I wanted to teach programming to kids using JavaScript. I just want them to learn fundamental programming skills like, conditionals and loops without getting into details of DOM and other things. So, what is the best approach/method/function to use with JavaScript that prints out data on the browser? I want to use JavaScript for following reasons: 1. We don't need any extra softwares. 2. Any student knows what is a website, and what they can expect there. 3. Students can understand what they are doing, because they can see the results instantatly. This is my own experience. When I studied C and C++, I never understood why I'm "typing" all these mysterious characters just to add 2 numbers. But, now when I do PHP and JavaScript programming, I very well understand what I'm doing and what I need my program to do. So far, I'm going with document.write method, but want to know better ideas. Link to comment Share on other sites More sharing options...
Paul Swanson Posted June 29, 2012 Share Posted June 29, 2012 I think that for your stated purposes, using document.write() will be fine. You could also use alert(). Link to comment Share on other sites More sharing options...
Larry Posted July 1, 2012 Share Posted July 1, 2012 This is a tricky issue when it comes to teaching (or writing about) JavaScript: how do you teach the initial things without having already explained some of the more advanced? Using document.write() is fine, so long as you let them know this is a hack and you wouldn't do it on a live site. Link to comment Share on other sites More sharing options...
sonal Posted July 10, 2012 Author Share Posted July 10, 2012 Thanks Larry, I appreciate your input here. It makes me more comfortable in my work.. Link to comment Share on other sites More sharing options...
Recommended Posts