我正在尝试在 Office 应用程序中实现 Bootstrap 3 选项卡,但我不断收到以下异常:
Unhandled exception at line 1453, column 2 in https://localhost:44303/Scripts/jquery-2.1.3.js
0x800a139e - JavaScript runtime error: Syntax error, unrecognized expression: #profile&_xdm_Info=null|null|null
基于此,Outlook 365 似乎正在附加&_xdm_Info=null|null|null
,但如果属实,我不明白为什么、如何或如何处理它。
这是一个整体简化Home.html
来说明问题。请注意,它可以正常工作是JSFiddle或Bootply。
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title></title>
<script src="../../Scripts/jquery-2.1.3.js" type="text/javascript"></script>
<link href="../../Content/bootstrap.css" rel="stylesheet" type="text/css"/>
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>
<script src="../../Scripts/bootstrap.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>
<div id="content-main">
<!--<div class="padding">-->
<ul class="nav nav-pills">
<li class="active">
<a href="#home" data-toggle="tab">Home</a>
</li>
<li>
<a href="#profile" data-toggle="tab">Profile</a>
</li>
<li>
<a href="#messages" data-toggle="tab">Messages</a>
</li>
</ul>
<div id='content' class="tab-content">
<div class="tab-pane active" id="home">
<ul>
<li>home</li>
<li>home</li>
<li>home</li>
<li>home</li>
<li>home</li>
<li>home</li>
<li>home</li>
</ul>
</div>
<div class="tab-pane" id="profile">
<ul>
<li>profile</li>
<li>profile</li>
<li>profile</li>
<li>profile</li>
<li>profile</li>
<li>profile</li>
<li>profile</li>
</ul>
</div>
<div class="tab-pane" id="messages">
</div>
</div>
</div>
</body>
</html>
这是我的调用堆栈-->
Sizzle.error [jquery-2.1.3.js] Line 1453 Script
Sizzle.tokenize [jquery-2.1.3.js] Line 2067 Script
Sizzle.select [jquery-2.1.3.js] Line 2474 Script
Sizzle [jquery-2.1.3.js] Line 850 Script
find [jquery-2.1.3.js] Line 2690 Script
jQuery.fn.init [jquery-2.1.3.js] Line 2798 Script
jQuery [jquery-2.1.3.js] Line 76 Script
Tab.prototype.show [bootstrap.js] Line 2050 Script
Anonymous function [bootstrap.js] Line 2123 Script
each [jquery-2.1.3.js] Line 374 Script
jQuery.prototype.each [jquery-2.1.3.js] Line 139 Script
Plugin [bootstrap.js] Line 2118 Script
clickHandler [bootstrap.js] Line 2147 Script
jQuery.event.dispatch [jquery-2.1.3.js] Line 4429 Script
elemData.handle [jquery-2.1.3.js] Line 4115 Script