[英]Cannot send information to dialog box in Outlook add-in
我無法向 Outlook 加載項中的對話框發送信息。 這是父級中的 Javascript 代碼:
var url2 = window.location.origin+'/dialogbox.html'
var dialog
Office.context.ui.displayDialogAsync(url2, {height: 50, width: 50},
function (asyncResult) {
dialog.messageChild('hello from the parent', {targetOrigin: "*" })
});
這對messageChild
命令成功完成。
子對話框中的Javascript是:
Office.onReady().then(function() {
Office.context.ui.addHandlerAsync(
Office.EventType.DialogParentMessageReceived,
onMessageFromParent);
});
function onMessageFromParent(arg){
console.log(arg.message)
}
但是,控制台中不會打印消息“來自父級的你好”。
相反,我在控制台中兩次得到以下信息:
Tracking Prevention blocked access to storage for https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js. [https://localhost:3000/commands.html?_host_Info=Outlook$Win32$16.02$en-US$$$$0]
我究竟做錯了什么? 如何將消息傳遞到對話框?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.