First Draft

First Draft of the Example Files
This commit is contained in:
RobinNixon
2020-12-10 13:21:38 +00:00
parent 77a7b57c4f
commit 0335342e00
1127 changed files with 46959 additions and 56 deletions
+11
View File
@@ -0,0 +1,11 @@
<html>
<head><title>Hello World</title></head>
<body>
<script type="text/javascript">
document.write("Hello World")
</script>
<noscript>
Your browser doesn't support or has disabled JavaScript
</noscript>
</body>
</html>
+9
View File
@@ -0,0 +1,9 @@
<html>
<head><title>Hello World</title></head>
<body>
<script type="text/javascript"><!--
document.write("Hello World")
// -->
</script>
</body>
</html>
+8
View File
@@ -0,0 +1,8 @@
<html>
<head><title>Hello World</title></head>
<body>
<script type="text/javascript">
document.write("Hello World)
</script>
</body>
</html>
+1
View File
@@ -0,0 +1 @@
Examples 04 to 07 are non-runnable illustrations of error messages
+6
View File
@@ -0,0 +1,6 @@
<script>
function product(a, b)
{
return a*b
}
</script>
+10
View File
@@ -0,0 +1,10 @@
<script>
n = '838102050' // Set 'n' to a string
document.write('n = ' + n + ', and is a ' + typeof n + '<br>')
n = 12345 * 67890; // Set 'n' to a number
document.write('n = ' + n + ', and is a ' + typeof n + '<br>')
n += ' plus some text' // Change 'n' from a number to a string
document.write('n = ' + n + ', and is a ' + typeof n + '<br>')
</script>
+6
View File
@@ -0,0 +1,6 @@
<script>
function product(a, b)
{
return a*b
}
</script>
+8
View File
@@ -0,0 +1,8 @@
<script>
function test()
{
a = 123 // Global scope
var b = 456 // Local scope
if (a == 123) var c = 789 // Local scope
}
</script>
+16
View File
@@ -0,0 +1,16 @@
<script>
test()
if (typeof a != 'undefined') document.write('a = "' + a + '"<br />')
if (typeof b != 'undefined') document.write('b = "' + b + '"<br />')
if (typeof c != 'undefined') document.write('c = "' + c + '"<br />')
function test()
{
a = 123
var b = 456
if (a == 123) var c = 789
}
</script>
+12
View File
@@ -0,0 +1,12 @@
<html>
<head>
<title>Link Test</title>
</head>
<body>
<a id="mylink" href="http://mysite.com">Click me</a><br />
<script>
url = document.links.mylink.href
document.write('The URL is ' + url)
</script>
</body>
</html>
+6
View File
@@ -0,0 +1,6 @@
<script>
function $(id)
{
return document.getElementById(id)
}
</script>