change ajax to java script