jquery - Throwing PHP error vs giving a different return in AJAX -


i'm pretty new php, , i'm using ajax validate form upon button click.

currently, i'm using if statement see whether continue on next page of multi-step form or not.

 $.ajax({       url: 'index.php',       type: 'post',       data: {         myid: 1,         action: action,         username: user,         password: pass       },       success: function(data){           if (data == "continue") {             wizard.next(wizard);             wizard.showbuttons();           } else {             helpframe.text(data);             helpframe.show();           }       }   }); 

i'm wondering when use if statement above in return ajax function vs. throwing error in php, since it's understanding can somehow use code purposely cause php throw error , execute different code upon "failure".


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -