Learning JAVASCRIPT From Scratch 2
Created | Updated Jan 28, 2002
On some older browsers, JS does not work at all - so you have to ensure that the page still displays your needs without it.
I am going to check the scripts I write on both browsers and will document it if one of them does not work on one of them.
I will also explain any html I use - this way it will get into my head and hopefully help those who are also just starting to learn how to code a webpage.
I will be using MS Note Pad to write the scripts but any text editor will do which can save the file in .txt and also .html.
To force Word Pad to save a file in a certain format, enclose the file name in ["] ie save the file test.html as "test.html"
I have made a folder on drive d: called javascript and save all experiments there - then by clicking on a newly made file, I can test the script in a browser off line.
Right lets start with something something simple. We want to put some wording on the page - OK I know there are simple ways of doing that - but we have to start somewhere.
script 1
<html>
<head>
<title>
document.write - script 1
</title>
</head>
<body>
<!-- script starts here -->
<!-- hide script from from non JS browsers
<script>
document.write("This text will appear on the screen")
</script>
end hiding script -->
</body>
</html>
explanation to be added
html & Javascript syntax = explains what the html tags are there for.
http://www.bbc.co.uk/h2g2/guide/A624502