在 Iframe 中加载 Office js 插件会出错 [英] Loading Office js addin inside Iframe gives error

查看:78
本文介绍了在 Iframe 中加载 Office js 插件会出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 iframe 中加载我的 office 插件.但是插件给出了错误.浏览器控制台日志显示消息警告:Office.js 已在 Office 客户端之外加载".在 IFrame 中显示 Office js 应用程序是否有限制?

I am trying to load my office addin within an Iframe. However the addin gives an error. The browser console log shows the message "Warning: Office.js is loaded outside of Office client". Is there a limitation in displaying an Office js application within an IFrame?

我使用的是 Chrome 浏览器

I am using Chrome browser

aspx 有一个加载 Office 环境的 js 文件.从控制台日志可以看到办公环境已加载.但是最后我收到警告消息警告:Office.js 是在 Office 客户端之外加载的"

The aspx has a js file which loads the Office environment. From the console log I can see that the office environment is loaded. However at the end I get the warning message "Warning: Office.js is loaded outside of Office client"

推荐答案

是的,看起来是一个限制,Office JS 使用 window.external 与 Office 客户端通信.

Yes, looks like it is a limitation, Office JS makes use of window.external to communicate with the Office client.

如果你 iframe 它,window.external 不会返回父的外部,所以这可能是下面错误的原因.

If you iframe it, window.external will not return parent's external, so that could be the reason for the below error.

警告:Office.js 在 Office 客户端之外加载

Warning: Office.js is loaded outside of Office client

您可以尝试更新外部,但我建议您不要使用 iframe.

You can try updating the external, but I recommend you not to iframe.

window.external = window.parent.external;

这篇关于在 Iframe 中加载 Office js 插件会出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆