setting up javascript for ajax post