i m facing a problem basically i have long running task that reads encoded bytes and then parse the bytes to find data in it.
functionLongRunningTask() {
//bytes returned from office.js (GetFileAsync Method)
var documentText = OSF.OUtil.encodeBase64(resultSlice.value.data);
// Open the document, which is stored as a base64 string.
var doc = new openXml.OpenXmlPackage(documentText);
var customXMLpart = doc.getPartByUri("/customXml/item1.xml");
if (customXMLpart == 'undefined' || customXMLpart == null) {
window.location = 'Page1.aspx'
}
else {
if (window.DOMParser) {
var parser = new DOMParser();
xmlDoc = parser.parseFromString(customXMLpart.data, "text/xml");
}
var customxml = xmlDoc.getElementsByTagName("DocumentID");
var documentid = 0;
for (var i = 0; i < customxml.length; i++) {
documentid = customxml[i].textContent;
}
window.location = 'Page2.aspx?documentid=' + documentid;
}
}
all of reading and traversing done on client side no server side involved in it. now as my application running in office word 2013 (Office APP basically) when i run this long Running task in synchronous way . UI gets freezed and stop responding and it restart Office APP.
i need to do it in Asynchronous way so UI dont get freeze i am using HTML5 and IE 9+. Any help will be appreciated
Regards