How to refresh page on getting 403?
How to refresh page on getting 403?
krupal.jadhav
Posts: 14Questions: 6Answers: 0
Hello everyone, I am trying to build a page which refreshes automatically when any of the web service the datatables makes a call to, returns a 403 error? How do I do this?
This discussion has been closed.
Answers
Hi @krupal.jadhav ,
DataTables doesn't make direct calls to web services automatically, so it'll be in response to something you're doing - so in the error handler for those calls you could force a page reload with location.reload()
Cheers,
Colin
Hi @colin ,
Can I do something like:
error: function (xhr, error, thrown) {
location.reload();
}
Give it a try, that's the best bet. It's really out of the scope of the DataTables forum - it's general JS coding.
better put a counter in there, you don't want to create an infinite loop cause the address is wrong or the network is down