Abrufen von Listendaten aus SharePoint-2010-Website mithilfe von Jquery

Ich bin versucht, um Listendaten aus sharepoint-Website mithilfe von JQuery, aber haben nichts zurückgegeben, noch, kein Fehler im firebug. Keine Ahnung, was falsch ist?

<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>

<script type="text/javascript">
$(document).ready(function() 
{
    var soapEnv =
        "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
            <soapenv:Body> \
                 <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                    <listName>Action Items</listName> \
                    <viewFields> \
                        <ViewFields> \
                           <FieldRef Name='Title' /> \
                       </ViewFields> \
                    </viewFields> \
                </GetListItems> \
            </soapenv:Body> \
        </soapenv:Envelope>";

    $.ajax({
        url: "http://my_site/_vti_bin/lists.asmx",
        type: "POST",
        dataType: "xml",
        data: soapEnv,
        complete: processResult,
        contentType: "text/xml; charset=\"utf-8\""
    });
});

function processResult(xData, status) {
    $(xData.responseXML).find("z\\:row").each(function() {
        console.log("aaaa");
        var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
        $("#tasksUL").append(liHtml);
    });
}
sehen Sie, dass die Anfrage in firebug net-tab? wenn dem so ist funktioniert es wieder ein 200-status? Ist diese Seite auf der gleichen Domäne wie der sp?

InformationsquelleAutor Chen Zhong | 2011-07-08

Schreibe einen Kommentar