update javascript for $.ajax