Generate JS code dynamically.