test javascript function