After executing my rest api I am getting call back to error with a textstatus 'parsererror'.(Sometimes only it shows parsererror)
I am using an iframe in window and imitate the ajax request from there.(IE shows the parser error but chrome works fine).
please see my below request.
return $.ajax({
type: 'GET',
async: true,
contentType: 'application/json; charset=utf-8',
url: this.serviceUrl + 'Documents?contextType=' + this.currentContextType + "&contextUid=" + this.currentContextUuid + "&dataSource=" + this.currentContextDataSource,
error: (jqXHR, textStatus, errorThrown) => {
if (jqXHR.status == 502 || !navigator.onLine) {
Common.Utils.connectionLost();
}
else if (textStatus === "parsererror") {
try {
throw new Error('textStatus:parsererror');
}
catch (e) {
console.log(e);
}
}
else if (jqXHR.status == 500 && jqXHR.responseText) {
WorkflowUI.Handlers.ErrorHandler.HandleErrorServiceLevel(JSON.parse(jqXHR.responseText));
}
},
success: (response) => {
this.tableData = response;
this.populateTable();
if (this.currentWidgetPosition.toLocaleLowerCase() === "left") {
setTimeout(function () {
parent.WorkflowUI.PowerJacketSingleton.showScannerWidget(this.currentContextUuid, this.currentContextDataSource);
}, 0);
}
}
});
What I have tried:
i have tried by POST and tried by catch the exception in error to avoid jquery object not supported error
Any way to suppress this error without showing jquery error.
Any answer is appreciated.