Complete programming language except ...
Can not open and save files
No data types
- Runs in a browser
No special programs needed
Is NOT Java
Many scripts available online and in Design Tools Example
WHERE TO ADD SCRIPT
Type into Address box of browser.
- Embed within page in the <body> section
- Embed in a page in the <head> section
Link to script in an external file
<script language =
Java Script is CaSe SeNsItIvE - Alert('hi') is not the same as alert('hi') and
will not work
Semi-colons at the end of statements are optional unless more than one statement on
Create comments using
// Only this line
is commented out
/* All of this code is
even though it is on different lines */
Experiment with the example above:
- Change the line alert("In head") to Alert("In head") and run the code. Does it work?
- Change the line alert("In head") to alert('In head') and run the code. Does it work?
- Add some text immediately after the <body> tag and run the code. Change the line alert("In head") to document.write("In head"). Run the code. Where is the expression "In head" relative to the text that you typed after the <body> tag?
- Use document.write to write out a hyperlink on the page.
- Add a comment to your <script> code.