separate template and js, make ajax query