Javascript




CS174

Chris Pollett

Oct. 11, 2010

Outline

Javascript

Uses of Javascript

Objects in Javascript

General Overview

Lexicon

Example Javascript and HTML document

<html>
<head><title>test</title>
<meta name="description" value="this example illustrates how Javascripts are executed both when the document is loaded and on the occurrence of events" />
<script type="text/javascript" ><!--
   function sayHello()
   {
		alert("hi there");
   } 
//-->
</script>
</head><body><form><input type="button" value="test" onClick="return sayHello();" 
/><!-- responds to events --></form>
<script type="text/javascript" ><!--
for( i = 0; i<100; i++)
{ 
	document.writeln("<p>hi"+i+"</p>");
} // run when document loads
-->
</script></body>
</html>

Primitives

Quiz

Which of the following statements is true?

  1. git revision numbers count up beginning with revision 0
  2. A git commit always affects the github repository.
  3. svn can use http/webdav to checkout/checkin to a repository.

Variables

Numeric Operators and Objects

Strings and Type Conversion