dialogApi 回调未在 iPad 中执行
dialogApi callback not executing in iPad
我正在开发一个 Excel 插件,其中我使用 dialogApi authentication.When 我调用 displayDialogAsync,回调函数不执行。
Office.context.ui.displayDialogAsync(url, { height: _height, width: _width}, dialogCallback)
var dialogCallback = function(asyncResult) {
if (asyncResult.status == "failed") {
// In addition to general system errors, there are 3 specific errors for
// displayDialogAsync that you can handle individually.
switch (asyncResult.error.code) {
case 12004:
jQuery("body").append("Domain is not trusted");
break;
case 12005:
jQuery("body").append("HTTPS is required");
break;
case 12007:
jQuery("body").append("A dialog is already opened.");
break;
default:
jQuery("body").append(asyncResult.error.message);
break;
}
}else{
jQuery("body").append("Success");
dialog = asyncResult.value;
dialog.addEventHandler(Office.EventType.DialogMessageReceived, messageHandler);
}
}
以上代码在 windows 和 Mac OS 中运行良好,但在 iPad 的情况下不执行回调。
我正在使用 Excel 1.25(160603)
-谢谢
如果您升级到最近的 Excel 版本,这个错误应该会消失。
我正在开发一个 Excel 插件,其中我使用 dialogApi authentication.When 我调用 displayDialogAsync,回调函数不执行。
Office.context.ui.displayDialogAsync(url, { height: _height, width: _width}, dialogCallback)
var dialogCallback = function(asyncResult) {
if (asyncResult.status == "failed") {
// In addition to general system errors, there are 3 specific errors for
// displayDialogAsync that you can handle individually.
switch (asyncResult.error.code) {
case 12004:
jQuery("body").append("Domain is not trusted");
break;
case 12005:
jQuery("body").append("HTTPS is required");
break;
case 12007:
jQuery("body").append("A dialog is already opened.");
break;
default:
jQuery("body").append(asyncResult.error.message);
break;
}
}else{
jQuery("body").append("Success");
dialog = asyncResult.value;
dialog.addEventHandler(Office.EventType.DialogMessageReceived, messageHandler);
}
}
以上代码在 windows 和 Mac OS 中运行良好,但在 iPad 的情况下不执行回调。 我正在使用 Excel 1.25(160603)
-谢谢
如果您升级到最近的 Excel 版本,这个错误应该会消失。