none
0x800a1391 - JavaScript runtime error: 'Office' is undefined RRS feed

  • Question

  • Hi all,

    I have been developing a mail app for office365 for about a month now and have not had this problem until today. When I try to run my app I get an error: 0x800a1391 - JavaScript runtime error: 'Office' is undefined I am not sure why I am getting this error, I am importing the office.js script so I am currently at a loss and don't know what to do next.

    HTML

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
        <title></title>
        <script src="../../Scripts/jquery-2.1.1.js" type="text/javascript"></script>

        <link href="../../Content/Office.css" rel="stylesheet" type="text/css" />
        <script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>

        <link href="../App.css" rel="stylesheet" type="text/css" />
        <script src="../App.js" type="text/javascript"></script>

        <link href="Home.css" rel="stylesheet" type="text/css" />
        <script src="Home.js" type="text/javascript"></script>
    </head>
    <body>

    ...

    ...

    </body>

    </html>

    JavaScript

    /// <reference path="../App.js" />

    (function () {
        'use strict';

        // The initialize function must be run each time a new page is loaded
        Office.initialize = function (reason) {
            $(document).ready(function () {
                app.initialize();

                $('#set-subject').click(setSubject);
                $('#get-subject').click(getSubject);
                $('#add-to-recipients').click(addToRecipients);
            });
        };

    ...

    ...

    })();

    When pressing F12 while the app is running in IE I have noticed that https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js is Aborted in the results field. Has the source for the script been changed? Its the only thing I can think of as I have not changed anything in the header of the html page.

    Thanks in advance

    Darryl

    Wednesday, November 5, 2014 5:11 PM

All replies

  • Hi Darryl,

    It looks like you're using VS to develop the app, right? What happens when you create a brand new project? Does it work there? Which version of IE is this happening in? What about Chrome?

    -Andrew

    Wednesday, November 5, 2014 8:53 PM