js. preparing for ajax call