I have a javascript code and want to extend this code now. how can I write a makeAMessenger function in global scope so that it triggers when user clicks document and alert
currently I have following code.Code:THIS. IS. SPART.
Code:function initiateMadness() {
var sparta = {
name : "Sparta"
};
function madness() {
alert("THIS. IS. " + this.name.toUpperCase() + ".");
}
document.onclick = makeAMessenger(madness, sparta);
}
initiateMadness();
