Server-side functions in JavaScript