Added receiveData function to allow for javascript to communicate with applet