I'm following this very simple web3 tutorial and Event.watch
doesn't seem to fire when I click the button.
I can't figure it out.
Can someone please help?
pragma solidity ^0.4.18; contract Coursetro { string fName; uint age; event Instructor( string name, uint age ); function setInstructor(string _fName, uint _age) public { fName = _fName; age = _age; Instructor(_fName, _age); } }
and then JS:
var instructorEvent = Coursetro.Instructor(); instructorEvent.watch(function(error, result){ alert(1); }); $("#button").click(function() { Coursetro.setInstructor('a', 1); });
alert never happens.
setInstructor
and if so, is it being mined?