make ajax to function