0

How can I turn off Dajaxproject alert 'Something goes wrong' ? Sometimes my dajax functions returns empty data, hence variables in html are None. It does suit me however dajax alert is displayed. I have heard there is DAJAXICE_EXCEPTION but I do not know how tu use it properly. What you would do, when the website is generaly finished?

user1403568
  • 493
  • 1
  • 5
  • 14

1 Answers1

0

This is purely speculative, and I haven't tested this myself, but I think the place you want to look is in line 87 of dajaxice.core.js:

valid_http_responses: function(){
    return {200: null, 301: null, 302: null, 304: null}
}

The section which throws errors is in line 51:

    if(this.responseText == Dajaxice.EXCEPTION || !(this.status in Dajaxice.valid_http_responses())){
            error_callback();
    }

So maybe changing valid_http_responses to:

valid_http_responses: function(){
    return {200: null, 204: null, 301: null, 302: null, 304: null}
}

From Wikipedia:

204 No Content:
    The server successfully processed the request, but is not returning any content

Maybe that will fix your issue?

moarCoffee
  • 1,289
  • 1
  • 14
  • 26