Thursday, 12 September 2013

Prototype pattern (calling function)

Prototype pattern (calling function)

I'm trying my hand at using Addy Osmani's prototype pattern.
I have an object "app" and, upon a submission of a form, I'm trying to
call a function inside of my init function. But it isn't
console.logging...
$(document).ready(function() {
var app = {
logHello: function() {
console.log('hello');
},
initialize: function() {
$('#userlogin').on('submit', function(){
this.logHello;
return false;
});
}
}
app.initialize();
});
Where am I going wrong?

No comments:

Post a Comment