Hey everyone,
I've been recently thinking on the best way of how to use AJAX calls to the server, but have standard requests in case AJAX requests failed for some reason (maybe JavaScript is turned off by the user or something). Or maybe in other cases, certain requests have to be standard ones, while others have to be AJAX ones.
Anyway, I was wondering how would you organize your code to keep it from turning into a huge mess. Would you handle both types of requests inside the same method? Or would you separate them into different methods?
I hope that was clear enough lol. Share your thoughts!
I've been recently thinking on the best way of how to use AJAX calls to the server, but have standard requests in case AJAX requests failed for some reason (maybe JavaScript is turned off by the user or something). Or maybe in other cases, certain requests have to be standard ones, while others have to be AJAX ones.
Anyway, I was wondering how would you organize your code to keep it from turning into a huge mess. Would you handle both types of requests inside the same method? Or would you separate them into different methods?
I hope that was clear enough lol. Share your thoughts!