Tutorial Index |
WA's Ultimate JavaScript Tutorial Lesson 1-Introduction Welcome to WebSite Abstraction's Ultimate JavaScript Tutorial. If you're here expecting to find a "true" JavaScript tutorial, welcome. This JavaScript tutorial will be constantly updated for new material and revisions. If you are content with using simply html for creating webpages, you are ready to head out to section15 , how to make fire with sticks; the rest of us, lets rock. One final word-there is quite a lot to absorb in in this tutorial if you're new to JavaScript...I'd like to offer a sincere advice, which is to take it slowly. Go through each lesson carefully, and actually try out the examples yourself. No one says you have to read through all 16 lessons in one day, and its all for the better that you go slowly, since this tutorial is considered right now to be the preliminary version, meaning that you can pretty sure expect changes and updates to the existing tutorial. Looking at the left border, you will see a direct link to my message board on every lesson-feel free to post questions to get help. In this section, we'll be looking at the following topics:
What is
JavaScript? Why learn
JavaScript?
Where does your JavaScript codes go? Well, basically anywhere inside the <html> tags of your page. The beginning of your code begins with <script> and ends with </script> <html> Output: Hi there. This text is written using JavaScript! As you can see, we began our script with the tag <script language="JavaScript"> The part in orange is purely optional, but you should include them to remind yourself-and others that you are using JavaScript now. The second and next to last lines of the above example are <!-- and //-->, which are the comment tags. These tags should ALWAYS be included to help hide your code against older browsers of both Netscape and IE. If you don't include them, and someone is using an old browser, the browser will just "dump" all your code as text onto the screen, in other words, not a pretty sight! The only "functional part" of this script is the document.write(".......") part. It basically writes to the page whatever you put inside the quotation marks. Don't worry so much about why this is so yet, we will discuss this in detail later. We end this entire code with </script> This terminates your script, and brings you back to html. Like html, you can insert comments in your JavaScript codes. Comments are ignored by the browser, and only used as reminder or documentation for your code. To basic syntax of inserting comments is either: // for single-lined comments, or /* .......*/ for multiple ones. For example: <script
language="JavaScript"> Ok, we are now ready to proceed to some real programming! |
|
|