Changed javascript logging into an event

Fixed!