nuAjax error

nuAjax error

Postby nekpap » Thu Mar 03, 2016 4:59 am

Hi,

is there any way to get a notification when nuAjax fails due to an error (for example a connection error)?

Thanks
Nektarios
nekpap
 
Posts: 27
Joined: Wed Dec 03, 2014 4:11 pm

Re: nuAjax error

Postby david » Thu Mar 17, 2016 1:37 pm

nekpap,

If you are using the latest version of nuBuilder, you can pass a fail function to nuAjax();

Example:

Code: Select all
nuAjax(
    'PROCEDURE_CODE',
    {
        async:true,
        data:{
            data_to_send_to_procedure: 'test'
        },
        done: function(){
            alert('Done.');
        },
        fail: function(){
            alert('Failed, connection error.');
        },
        always: function(){
            alert('Finished ajax call.');
        }
    }
);
david
 
Posts: 4
Joined: Mon Jun 15, 2009 5:31 pm

Re: nuAjax error

Postby nekpap » Mon Apr 04, 2016 1:40 am

Thanks David! I will try it!
nekpap
 
Posts: 27
Joined: Wed Dec 03, 2014 4:11 pm

Re: nuAjax error

Postby admin » Thu May 19, 2016 10:35 am

.
admin
Site Admin
 
Posts: 3233
Joined: Mon Jun 15, 2009 9:53 am


Return to General