Office API Javascript - Loading error telemetryproxy.html not found

≯℡__Kan透↙ 提交于 2020-01-24 20:18:26

问题


I tried to load Office.js to my application.

I've added the <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

and Error: o15apptofilemappingtable.js:11 GET https://telemetryservice.firstpartyapps.oaspapps.com/telemetryservice/telemetryproxy.html 404 (Not Found)

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?

Thanks!


回答1:


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.



来源:https://stackoverflow.com/questions/49475805/office-api-javascript-loading-error-telemetryproxy-html-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!