admin管理员组

文章数量:1327807

I am trying to create a simple HTML page where i wanted to display a list of items from a SharePoint list. Basically my JavaScript has to pull the data from SharePoint list and display in HTML page.

I have tried some sample from internet, nothing worked. Can anybody have any samples on this. Please help me to implement this.

I am trying to create a simple HTML page where i wanted to display a list of items from a SharePoint list. Basically my JavaScript has to pull the data from SharePoint list and display in HTML page.

I have tried some sample from internet, nothing worked. Can anybody have any samples on this. Please help me to implement this.

Share Improve this question edited Jun 3, 2012 at 21:29 Chad Ferguson 3,0915 gold badges37 silver badges42 bronze badges asked Apr 6, 2011 at 6:18 DineshDinesh 2,0668 gold badges40 silver badges61 bronze badges 1
  • This is too vague. Please ask a specific question (and provide sample code if possible). – JustinStolle Commented Apr 6, 2011 at 6:32
Add a ment  | 

1 Answer 1

Reset to default 5

You can use jQuery Library for Sharepoint WebService

<script type="text/javascript" src="filelink/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="filelink/jquery.SPServices-0.5.4.min.js"></script>
<script language="javascript" type="text/javascript">

$(document).ready(function() {
  $().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "Announcements",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
    pletefunc: function (xData, Status) {
      $(xData.responseXML).find("[nodeName='z:row']").each(function() {
        var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
        $("#tasksUL").append(liHtml);
      });
    }
  });
});
</script>
<ul id="tasksUL"/>

本文标签: Accessing Sharepoint list data in a normal HTML page using JavaScriptStack Overflow