I'm trying to do if/else inside Ajax , but as you can see in my script I'm repeating my code and i think it is better way do archive this in one line or doing if/else before Ajax and to be honest i don't know how exactly should i do Can anyone please help me or point me in the right direction! I'm trying to do if/else inside Ajax , but as y