我有一个SharePoint 2010网页,我正在构建一个简单的SharePoint列表。这个想法是一个列表,该列表会自动构建SharePoint页面的上半年。该页面在FF和Chrome中很好地呈现,但在IE中没有。它永远不会将列表的内容加载到所需的Divs中。几乎就像代码没有发射一样。感谢您的帮助!
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$().SPServices({
operation: "GetListItems",
async: false,
listName: "HomepageControl",
CAMLViewFields: "<ViewFields><FieldRef Name='Item1link' /><FieldRef Name='Item2link' /><FieldRef Name='Item3link' /><FieldRef Name='Item4link' /><FieldRef Name='Item1image' /><FieldRef Name='Item2image' /><FieldRef Name='Item3image' /><FieldRef Name='Item4image' /><FieldRef Name='FeatureEnabled' /><FieldRef Name='WelcomeMessage' /><FieldRef Name='PageHeading' /></ViewFields>",
completefunc: function (xData, Status) {
$(xData.responseXML).SPFilterNode("z:row").each(function() {
var newhtml = "<div id='contentheaderbar'>" + $(this).attr("ows_PageHeading") + "</div>" + "<div id='dasheddividerbin'><img width='2' height='5' src='/sites/corpcomm/SiteAssets/TemplateTest/images/fill.gif' border='0'/></div>" + "<div class='whitebg' id='innercontentbin' style='text-align: right; '>" +
"<div id='WelcomeBin'>" + $(this).attr("ows_WelcomeMessage") + "</div>" + "<div id='FeaturedBin'><h2>Featured Links:</h2><ul>" + "<li><a href='" + $(this).attr("ows_Item1link") + "' target='_blank'><img width='166' height='106' src='" + $(this).attr("ows_Item1image") + "' border='0'/></a></li>" + "<li><a href='" + $(this).attr("ows_Item2link") + "' target='_blank'><img width='166' height='106' src='" + $(this).attr("ows_Item2image") + "' border='0'/></a></li>" + "<li><a href='" + $(this).attr("ows_Item3link") + "' target='_blank'><img width='166' height='106' src='" + $(this).attr("ows_Item3image") + "' border='0'/></a></li>" + "<li><a href='" + $(this).attr("ows_Item4link") + "' target='_blank'><img width='166' height='106' src='" + $(this).attr("ows_Item4image") + "' border='0'/></a></li>" + "</ul><div class='clear'></div></div><div class='clear'></div></div></div>" + "<div id='dasheddividerbin'><img width='2' height='5' src='/sites/corpcomm/SiteAssets/TemplateTest/images/fill.gif' border='0'></div>"
$('#maindiv').append(newhtml);
});
}
});
});
</script>
<div id="maindiv"></div>
我将所有内容撕开并重新构建了,它运行良好。我必须在图像插入区域中有一些语法错误。谢谢!