$Id: review-jsintro.txt,v 1.1 2006/02/14 18:52:21 locasto Exp $ Spring 2006 COMS 1001 ---------------------------------------------------------------------- Introduction To JavaScript Review 0. What is Javascript? Javascript is an object-based programming language for scripting. It is most often used to enable dynamic client-side content in HTML pages. 1. What are two ways of performing output in Javascript? a) use the document.write() function to write a string or contents of a variable into the text of the page itself b) use the alert() function to pop up a dialog box with a message 2. How do you signal the start of a Javascript program in an HTML page? Use the "script" tag. Any text inside the appropriate start and end "script" tags is interpreted as Javascript, not as HTML. 3. What four main entities is a Javascript program composed of? a) variables (data declarations) b) statements (instructions or operations on that data) c) functions (collections of related statements) d) keywords (special reserved words that have a particular command or meaning) 4. How do you declare a variable in Javascript? You need to declare a variable in order to refer to its data in a meaningful way. You can declare a variable by using the 'var' keyword and giving the variable a name: var myVariable; You end this statement with a semicolon, as with any program statement.