Jump to content
Larry Ullman's Book Forums

Document.Writeln


Recommended Posts

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

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

  • 2 weeks later...
 Share

×
×
  • Create New...