CEWP中的html文件仅适用于编辑模式

时间:2014-11-03 22:10:15

标签: jquery sharepoint sharepoint-2010 cewp

我在SharePoint 2010中使用CEWP通过内容链接链接到HTML文件,但jQuery似乎只在页面处于编辑模式时运行。 HTML正在显示,但没有显示通过jQuery创建的内容。注意事项:

  • " Hidden"未选择Web部件属性
  • 我的脚本链接包括" text =' text / javascript'"
  • 完全相同的HTML文件适用于我的开发环境,但不适用于测试
  • 网站的权限在开发和测试中相同
  • 在我将页面置于编辑模式之前,页面上的其他任何Web部件都没有工作,但是如果我删除了相关的Web部件,则其他Web部件将在编辑模式之外开始工作。

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>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

事实证明,另一个Web部件引用了一个不在site assets文件夹中的jquery文件。我在root(它正在寻找)替换了该文件,问题得到了解决。

相关问题