Ok, so here's the rundown. I have a site with three child sites, and I am trying to get a rollup of content from these three sites. Each site has the same list of "Initiatives" and on the parent site the client would like to see All of the initiatives. This works fantastically in FF, however i just get an exception thrown in IE. Here is the code:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var subSite = new Array();
$().SPServices({
operation: "GetAllSubWebCollection",
completefunc: function(xData, Status) {
$(xData.responseXML).find("Webs > Web").each(function() {
var $node = $(this);
var siteTitle = $node.attr("Title").replace(/\s/g, "");
subSite.push( siteTitle );
});
}
});
for(i=0;i<4;i++){
$().SPServices({
operation: "GetListItems",
webURL: "/"+subSite[i]+"",
async: false,
listName: "Initiatives",
CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
completefunc: function(xData, Status){
alert(xData.responseText);
console.log( xData.responseText );
$(xData.responseXML).SPFilterNode("z:row").each(function(){
var liHtml = "<li><a href='/"+subSite[i]+"/SitePages/InitiativeOverview.aspx?"+$(this).attr('ows_Title')+"'>" + $(this).attr("ows_Title") + "</a></li>";
$("#initiativeList").append(liHtml);
});//end xData
}//end function
});//end SPServices
}//end for
});
</script>
Any thoughts or guidance is greatly appreciated. I don't know why this wouldn't work, I have tried using the alternative z\:row in the SPFilterNode and it still returns nothing but an exception.
The exception is:
LOG: <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">There is no Web named "/undefined/_vti_bin/Lists.asmx".</errorstring></detail></soap:Fault></soap:Body></soap:Envelope>
Again, thanks for any input!!
