Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

RestCurdop.aspx:757 Uncaught ReferenceError: data is not defined

$
0
0
function readListItem()
{
debugger;
//Fetch the values from the input elements 

 
 

var url = _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('Employee')/items?$select=Title,Designation,Email,Mobile,BloodGroup,CommunicationAddress,EmergencyContact";



$.ajax({

    url: url,
method: 'POST',
    data: data,                             

headers: {


            "Accept": "application/json;odata=verbose",  
            "Content-Type": "application/json;odata=verbose",  
            "X-RequestDigest": $("#__REQUESTDIGEST").val(),  
            "IF-MATCH": "*",  
            "X-HTTP-Method": null  

},

success: function(data) { 

$("#ResultDiv").empty();  
            for (var i = 0; i < data.d.results.length; i++)   
            {  
                var item = data.d.results[i];  
   $("#ResultDiv").append(item.Title + "\t" + item.Designation + "\t" + item.Email + "\t" +item.Mobile+ "\t" +item.BloodGroup+ "\t" +item.CommunicationAddress+"\t" +item.EmergencyContact+ "<br/>");  
            } 
}, 

error: function(error) { 

alert(JSON.stringify(error)); 
         


});
}
 

</script>

Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>