switch from onmessage to this.onmessage

fixes the JS examples