change ajax call to js data