Dinesh Dinesh - 1 year ago 110
HTML Question

Accessing Sharepoint list data in a normal HTML page using JavaScript

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.

vvk vvk
Answer Source

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() {
    operation: "GetListItems",
    async: false,
    listName: "Announcements",
    CAMLViewFields: "<ViewFields><FieldRef Name='Title' /></ViewFields>",
    completefunc: function (xData, Status) {
      $(xData.responseXML).find("[nodeName='z:row']").each(function() {
        var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>";
<ul id="tasksUL"/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download