当我首先启动我的加载项时,它显示以下错误:
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>
谢谢。