SharePoint List Operations on SharePoint 2013 using REST API Services In - Part IV (GET All Items)

function GetItems()
{
 
    $.ajax
    ({
        url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('SharePoint List Name')/items?$select=Column1,Column2",
        type: type,
        data: data,
        headers:
        {
            "Accept": "application/json;odata=verbose",
            "Content-Type": "application/json;odata=verbose",
            "X-RequestDigest": $("#__REQUESTDIGEST").val(),
            "IF-MATCH": "*",
            "X-HTTP-Method": null
        },
        cache: false,
        success: function(data)  
        {
    //success - bind values here
            $("#sampleDIV").empty();
            for (var i = 0; i < data.d.results.length; i++)  
            {
                var item = data.d.results[i];
                $("#sampleDIV").append(item.Column1);
            }
        },
        error: function(data)
        {
            //Failure
        }
    });
}  

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell