Use some (client-side) js code from java