Override Wisej javascript

0
0

Hi,

I would like to override  function loadResources to handle xhr.status = 401 (Unauthorized).  Right now it shows an alert with text “Loader Error: ” and after that an empty page. I want it to redirect to login page.

function loadResources(options, callback) {

if (options.enablePWA && !navigator.onLine) {
location.href = offlineUrl;
return;
}

xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {

if (xhr.status == 200) {
var resources = JSON.parse(xhr.responseText);
callback(resources);
}
else {

if (options.enablePWA) {
location.href = offlineUrl;
}
else {
alert(“Loader Error: ” + xhr.statusText);
}
}
}
};
….

xhr.send();
}

 

Thank you for your help.

Page

  • You must to post comments
0
0

If default.html loaded then it’s authorized which  means that the request to resource.wx must work or it’s a wrong installation. Basic IIS authentication should be configured for the entry page, which can be an html or an aspx or php or anything else.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.