I have a asp.net button that render as,
<button onclick="Person.Eat.rice();">Click me</button>
I am using Object Literal Pattern here,
var Person = Person || {};
Person.Eat = {
rice: function() {
console.log("Eating Rice");
},
};
Error
Uncaught ReferenceError: Person is not defined
Question
Is there anyway I can use Object Literal Pattern in ASP.Net Button's onclick event like above ?
Fiddle