Steve's Hot Javascript Training - Writing some code - Part 1
OVERVIEW
In the previous part of the series, we left out checking out some pretty cool demos that JavaScript can do.LET'S GET TO THE FUN STUFF - WRITING SOME CODE!
Thank you for all your patience for waiting to get to the fun side -- writing some actual code! At this level, I'm going to start with the basics. In fact, I'm going to cover things that I feel I was missing when I took computer programming back in 1996.WHAT IS A STATEMENT?
A statement is what I learned first in computer programming. You see, inside our files are Instructions that tell our program what to do. One common one in all programs in printing, whether to a screen, a printer...pretty much all output devices. The only thing I've seen it not print to is my own nose!So, think of statement as commands, like do_this or do_that. The web browser of your choice will execute your commands line by line. It's as if you're reading a paper of things-to-do and you're reading "Step 1, do this", "Step 2, do that". This is how you will write your own JavaScripts.
LET'S EXPLAIN BY EXAMPLE
To print to the web browser, we will use the "[removed]" function. Actually, the word "write" is actually the function and the word "document" is an object, or even class. If this is confusing, don't worry! I'll be explaining this is much more detail. Here is how we would write the code:
As you can tell, the first thing we have here is a document object. There are lots of objects that are built-in to JavaScript. Some like this, print to the screen. The next thing you see here is that we have a function named, "write". This writes to the web browser. Finally, there is the text that we want to print the screen, which is "print this to the web browser". Yes, now we can print anything to the web browser!
SUMMARY
I will be explaining this is much more more detail in the next part of the series. Here's a question. Can any one explain to me what the dot is in between document and write? I don't have my glasses! ;)
Feel free to add any comments, questions, or suggestions. I'll see you in the next training!
Recent Comments
5
Does the period mean stop. so that the two words are separated. So one stay a command and the other stay a single action. ????
Well, that's part of the answer. It does separate the two words from each other. However, there is another meaning to this!
I give up ;O) I guess I'll have to wait and see if someone else gets it or, wait until Part ll
See more comments
Definitely informative and simple to understand, worth following!