How to refresh page on getting 403?
How to refresh page on getting 403?
![krupal.jadhav](https://secure.gravatar.com/avatar/095629e474846e9a293ab0549e679458/?default=https%3A%2F%2Fvanillicon.com%2F095629e474846e9a293ab0549e679458_200.png&rating=g&size=120)
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