How to refresh page on getting 403?

How to refresh page on getting 403?

krupal.jadhavkrupal.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?

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

  • krupal.jadhavkrupal.jadhav Posts: 14Questions: 6Answers: 0

    Hi @colin ,

    Can I do something like:

    error: function (xhr, error, thrown) {
    location.reload();
    }

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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.

  • Bindrid2Bindrid2 Posts: 79Questions: 4Answers: 12

    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

This discussion has been closed.