Hey! Listen!
Play with those buttons to simulate events exchanged in a MVC architecture
M
window.hey("m")
window.addEventListener("v",function(){alert("m heard v")})
window.addEventListener("c",function(e){alert("m heard c. detail:"+e.detail)})
V
window.hey("v")
window.addEventListener("m",function(){alert("v heard m")})
window.addEventListener("c",function(e){alert("v heard c. detail: "+e.detail)})
C
window.hey("c","my c details")
window.addEventListener("m",function(){alert("c heard and m and fired");window.hey("c","my c details")})
window.addEventListener("v",function(){alert("c heard and v and fired");window.hey("c","my c details")})
By
Maxime Euzi�re
-
Fork me on Github