小编Spa*_*tan的帖子

未捕获的TypeError:window.external.GetContext不是函数

我创建了一个角度应用程序,并希望使用JS API库.我想在Office 365 Outlook中使用此应用程序.但是,我收到以下错误:

Uncaught TypeError: window.external.GetContext is not a function
OSF.InitializationHelper.getAppContext  @   o15apptofilemappingtable.js:11
Run Code Online (Sandbox Code Playgroud)

我在浏览器上运行index.html,最终我将从Office 365 outlook中运行它.以下是代码:

index.html的:

<!DOCTYPE html>
<html ng-app="app">

  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Office 365 APIs sample</title>
    <base href="/">

    ...
    ...

    <!-- JavaScript Office API -->
    <script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>

    <!-- App code. -->
    <script src="scripts/app.js"></script>
    <script src="controllers/homeController.js"></script>

  </head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

app.js:

(function () {     
      console.log("STARTING...");
      var init = function (reason) {
            $(document).ready(function () {
                console.log("ready");
            });
        };

      try {
          Office.initialize = init; …
Run Code Online (Sandbox Code Playgroud)

office365 office365-apps office-js

14
推荐指数
2
解决办法
1995
查看次数

标签 统计

office-js ×1

office365 ×1

office365-apps ×1