Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There could be several reasons why the JavaScript Ajax is opting for the else condition even if the return is for the first condition.

One possible reason could be that there is a syntax error or typo in the code that is causing the condition to be evaluated incorrectly. Another possible reason could be that the values of the variables or parameters that are being compared in the condition are not what was expected.

It is also possible that there is an issue with the server-side code, and that it is not returning the expected response.

Without more information and context about the specific code being used, it is difficult to determine the exact reason why the JavaScript Ajax is opting for the else condition.