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">
        var subSite = new Array();

        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 );

                operation: "GetListItems",
                webURL: "/"+subSite[i]+"",
                async: false,
                listName: "Initiatives",
                CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
                completefunc: function(xData, Status){

                    console.log( xData.responseText );
                        var liHtml = "<li><a href='/"+subSite[i]+"/SitePages/InitiativeOverview.aspx?"+$(this).attr('ows_Title')+"'>" + $(this).attr("ows_Title") + "</a></li>";
                    });//end xData
                }//end function
            });//end SPServices
        }//end for

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!!


You don't have async: false, on the first SPServices call to get the sites, so IE is probably just behaving as expected and continues to make the new requests without anything entered into subSites.

I don't know why FF fails to run the request async, but that just shows you shouldn't use that if you want right behaviour

|improve this answer|||||
  • This was it, Dumb...Dumb...Dumb... Thanks Per Jakobsen – Brenton Pierce May 24 '12 at 19:30

My guess is that something gets screwed up in this line: webURL: "/"+subSite[i]+"" as the error states: There is no Web named "/undefined/_vti_bin/Lists.asmx

If you debug the for loop, are you getting results for all the iterations?

|improve this answer|||||
  • It is getting stopped there. I changed the line for(i=1...) and it is still coming accross as undefined the first loop through, any ideas? – Brenton Pierce May 24 '12 at 18:50

An easy fix (and better codeing practice) would be to change your for loop to something like this:


Based on your code it seems like you want to loop through every site returned, not 4 sites regardless of how many sites are returned. As far as why a different number of sites are being returned in IE vs FF, I'm not quite sure. If you post your xData.responseXML from IE and from FF, I might be able to help more.

|improve this answer|||||
  • The same number of sites are being returned in FF, and the same exception is being thrown in FF however FF just ignores it and keeps chugging. – Brenton Pierce May 24 '12 at 19:07
  • Can you post your xData.responseXML? – Abe Miessler May 24 '12 at 19:09
  • <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="schemas.xmlsoap.org/soap/envelope" xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/… of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="schemas.microsoft.com/sharepoint/soap/">There is no Web named "/GST/_vti_bin/Lists.asmx".</errorstring></detail></soap:Fault></soap:Body></soap:Envelope> – Brenton Pierce May 24 '12 at 19:15
  • Not sure if that's what you want? – Brenton Pierce May 24 '12 at 19:15
  • It's the xData.responseXML from the first request we need to see why you don't get the site information when running IE – Per Jakobsen May 24 '12 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.