0

当我首先启动我的加载项时,它显示以下错误:

0x80070005 - JavaScript 运行时错误:访问被拒绝。

并突出显示

var t=window.localStorage

js文件中的代码。单击继续按钮后加载项工作。请告诉我如何在使用 Visual Studio 2015 运行 Word 加载项时处理此错误。

我使用了 word javascript api,当我尝试使用本地存储时,由于本地存储问题,加载项停止工作。

页眉:

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <title>Testing</title>

    <script src="Scripts/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui-1.12.0.custom/jquery-ui.min.js" type="text/javascript"></script>
    <script src="Scripts/FabricUI/MessageBanner.js" type="text/javascript"></script>

   <script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>
    <script src="Scripts/Office/MicrosoftAjax.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="fonts/css/font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="Scripts/jquery-ui-1.12.0.custom/jquery-ui.min.css" />
    <link href="Home.css" rel="stylesheet" type="text/css" />
    <script src="DesignElements.js" type="text/javascript"></script>



    <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/2.2.0/fabric.min.css">
    <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/2.2.0/fabric.components.min.css">
    <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/2.2.0/fabric.css">
    <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/2.2.0/fabric.components.css">

    <!--During development turn off caching-->
  <meta http-equiv="cache-control" content="max-age=0" />
  <meta http-equiv="cache-control" content="no-cache" />
  <meta http-equiv="expires" content="0" />
  <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
  <meta http-equiv="pragma" content="no-cache" />
</head>

谢谢。

4

1 回答 1

0

这就是我的想法,我对面料有一个奇怪的问题,所以我把它放在最后。我会尝试组织,看起来你真的在调用一些不同步的东西

<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title>MY Example</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" type="text/javascript"></script>
<script src="https://secure.aadcdn.microsoftonline-p.com/lib/1.0.12/js/adal.min.js" type="text/javascript"></script> 

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

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.2/moment.js" type="text/javascript"></script>
<script src="GeneralContent/GeneralContent.js" type="text/javascript"></script>
<script src="Graphics/Graphics.js" type="text/javascript"></script>


<link href="https://kendo.cdn.telerik.com/2016.3.1028/styles/kendo.common.min.css" rel="stylesheet" />
<script src="https://kendo.cdn.telerik.com/2016.3.1028/js/kendo.all.min.js" type="text/javascript"></script>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />

<link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/fabric-core/4.0.0/fabric.min.css">

<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
于 2016-11-03T12:03:16.417 回答