我正在使用SharePoint 2010中的CEWP通过内容链接链接到HTML,但是jQuery似乎只在页面处于编辑模式时才运行。HTML正在显示,但是通过jQuery创建的内容都没有显示出来。要注意的事情:
HTML文件代码如下:
<script type='text/javascript' src='/SiteAssets/jquery-1.6.2.min.js' ></script>
<style type="text/css">
#lineComment{
width:10px;
height:10px;
padding-left: 3px;
}
#tripReclose{
float:left;
margin-right:7px;
}
#tripReclose th{
padding-right:7px;
text-align:left;
}
#tripReclose td, #openBreaker td{
/*border-left:thin #E5E5E5 solid;
border-right:thin #E5E5E5 solid;*/
border-top:thin #E5E5E5 solid;
border-bottom:thin #E5E5E5 solid;
}
#tripReclose caption{
text-align:left;
font-weight:bold;
padding-top:5px;
padding-bottom:5px;
}
#openBreaker{
float:left;
}
#openBreaker th{
padding-right:7px;
text-align:left;
}
#openBreaker caption{
text-align:left;
font-weight:bold;
padding-top:5px;
padding-bottom:5px;
}
</style>
<div id="lineStatus">
<table id="tripReclose">
<caption>Trip and Reclose Events</caption>
<tbody>
<tr>
<th>Service Point</th><th>Event Date</th><th>Fault Target</th><th>Device jquery-1.6.2.minName</th>
</tr>
</tbody>
</table>
<table id="openBreaker">
<caption>Open Breaker Events</caption>
<tbody>
<tr>
<th>Service Point</th><th>Open Date</th><th>Close Date</th><th>Device Name</th><th>PLT Assigned</th>
</tr>
</tbody>
</table>
</div>
<script type="text/javascript">
/* Run custom JavaScript that retrieves list items via CAML - I cannot specify this code but can guarantee it works */
</script>
发布于 2014-11-04 17:33:10
结果发现,另一个web部件引用的jquery文件不在网站资产文件夹中。我在根(它正在查找的地方)替换了那个文件,这个问题就解决了。
https://stackoverflow.com/questions/26724191
复制相似问题