Skip to content

Instantly share code, notes, and snippets.

@conspirator
Created October 8, 2010 04:16
Show Gist options
  • Save conspirator/616350 to your computer and use it in GitHub Desktop.
Save conspirator/616350 to your computer and use it in GitHub Desktop.
<!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