Move ajax method to js file, comment javascript