Jump to content

Ajax call to controller


BartekPresta

Recommended Posts

I have ajax 

$.ajax(ajaxSettings).fail(onFail).success(onSuccess)

 

But i dont know how to pass from controller data with error to get to onFail function.

 

I tried 

        $data = array(
            'hasError' => true,
            'order_id' => null,
        );
        $this->ajaxDie(json_encode($data));

 

but ajax always ended in success function 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...