java script handling (issue #77)