Created
October 8, 2010 04:16
-
-
Save conspirator/616350 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>OOJS Test Page</title> | |
<script type="text/javascript"> | |
var Person = function(){ | |
this.firstName = "Barack"; | |
this.lastName = "Obama"; | |
this.job = "President"; | |
} | |
Person.prototype.writePerson = function(){ | |
document.write(this.firstName + " " + this.lastName + " - " + this.job); | |
} | |
function init() { | |
var president = new Person(); | |
president.writePerson(); | |
} | |
</script> | |
</head> | |
<body onload="init()"> | |
// body goes here | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment