added example for JavaScript (cheap, but maybe useful to some)