Office API Javascript-找不到加载错误telemetryproxy.html [英] Office API Javascript - Loading error telemetryproxy.html not found

查看:162
本文介绍了Office API Javascript-找不到加载错误telemetryproxy.html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将Office.js加载到我的应用程序中.

I tried to load Office.js to my application.

我添加了<script src="https://appsforoffice.microsoft.com/lib/1/hosted/Office.js" type="text/javascript"></script>

并且我在控制台中收到警告和错误.

and I get warning and error in console.

Warning: Office.js is loaded outside of Office client

和错误:o15apptofilemappingtable.js:11 GET https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html 404 (Not Found)

我创建的app.js包含:

I created app.js contains:

Office.initialize = function (reason) {
$(document).ready(function () {
    switch (reason) {
        case 'inserted': console.log('The add-in was just inserted.');
        case 'documentOpened': console.log('The add-in is already part of 
              the document.');
    }
  });
};

有人可以帮助我,我该如何解决?

Someone can help me please how can I fix it?

谢谢!

推荐答案

当您尝试在浏览器页面中打开加载项时,将出现第一个错误. Office.js将仅在Office应用程序内部工作,例如在任务窗格中.若要运行正在开发的加载项,需要将其侧面加载到Office应用程序中.如果使用的是Visual Studio,则只需按F5.如果使用其他编辑器,则需要使用一种侧载技术.有关详细信息,请参见用于测试的Sideload Office加载项.

The first error is expected when you try to open the add-in in a browser page. Office.js will only work inside an Office application, such as in a task pane. To run an add-in that you are developing, you need to sideload it into an Office application. If you are working with Visual Studio, you can just press F5. If you are working with a different editor, you need to use one of the sideloading techniques. For details, see Sideload Office Add-ins for testing.

第二个错误可能是第一个错误的副作用.

The second error is probably a side effect of the first one.

这篇关于Office API Javascript-找不到加载错误telemetryproxy.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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