chandler's blog - MOSS SharePoint 2007, Office 2007, Windows Server 2003 RSS 2.0
 Sunday, 04 October 2009

Add jQuery to your SharePoint System and add the following script into a Content Editor Webpart:

<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>Tasks</listName> \
                        <viewFields> \
                            <ViewFields> \
                               <FieldRef Name='Title' /> \
                           </ViewFields> \
                        </viewFields> \
                    </GetListItems> \
                </soapenv:Body> \
            </soapenv:Envelope>";

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

    function processResult(xData, status) {
        var counter = 0;
        $(xData.responseXML).find("z\\:row").each(function() { counter = counter + 1;
var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>"; $("#tasksUL").append(liHtml); });

$("#counter").html(counter);
} </script> <ul id="tasksUL"/>
<div id="counter"></div>
Sunday, 04 October 2009 15:46:40 (W. Europe Standard Time, UTC+01:00)  #    -
SharePoint
About the author
DI(FH) Handler Christian

DI(FH) Handler Christian
Graz, Austria


SharePoint Consultant &
Information Manager

© Copyright 2017
Categories
Archive
<2009 October>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
Blogroll
Statistics
Total Posts: 19
This Year: 0
This Month: 0
This Week: 0
Comments: 59

Sign In
All Content © 2017, DI(FH) Handler Christian
Graz, Austria