JavaScript Tutorial
Wednesday, January 13, 2010
How To Write JavaScript
If you have ever used CSS before, you will find the whole part about including JavaScript will be a lot simpler to grasp. Here are Tizag's three important steps you should always follow when creating or using someone else's JavaScript code:
1. Use the script tag to tell the browser you are using JavaScript.
2. Write or download some JavaScript
3. Test the script!
There are so many different things that can go wrong with a script, be it human error, browser compatibility issues, or operating system differences. So, when using JavaScript, be sure that you test your script out on a wide variety of systems and most importantly, on different web browsers.
HTML & JavaScript Code:
To follow the classic examples of many programming tutorials, let's use JavaScript to print out "Hello World" to the browser. I know this isn't very interesting, but it will be a good way to explain all the overhead required to do something in JavaScript.
Our first step was to tell the browser we were using a script with the
1 comments:
[ Placing Code ]
[ Functions ]
[ Events ]
[ Comments ]
[ Conditionals-looping ]
[ Hiding the JavaScript ]
[ Date object ]
[ Prompt Method ]
[ Alert Method ]
[ Confirm Method ]
[ write and writeln ]
[ Operators ]
[ Variable ]
[ When JS Statements Run ]
[ Objects ]
[ Examples ]
[ Glossary Terms ]
Post a Comment