Skip to content

Instantly share code, notes, and snippets.

@ZenCocoon
Created November 23, 2009 12:27
Show Gist options
  • Save ZenCocoon/241043 to your computer and use it in GitHub Desktop.
Save ZenCocoon/241043 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>untitled</title>
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script>
<script type="text/javascript">
OtherClass = Class.create({
initialize: function() {
this.my_name = "otherclass";
},
otherMethod: function(string) {
console.debug(string);
console.debug(this);
return this;
},
});
App = Class.create({
initialize: function() {
this.my_name = 'app';
this.otherClass = new OtherClass;
this.otherClass.otherMethod.defer('defer');
this.otherClass.otherMethod.bind(this.otherClass).defer('defer with bind');
this.otherClass.otherMethod('classic');
}
});
document.observe("dom:loaded", function() { var app = new App; });
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment