following is the code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<div id="ResultDiv"></div>
<script language="javascript" type="text/javascript">
function getListItem(url, listname, id, complete, failure) {
alert('hi');
// Getting our list items
$.ajax({
url:'http://wzspf2:300/sites/Sample'/ + "/_api/web/lists/getbytitle('" + CompanyInfo + "')/items(" + id + ")",
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
success: function (data) {
// Returning the results
complete(data);
},
error: function (data) {
failure(data);
}
});
}
}
</script>
but i am getting failed to load error. Please give me solution asap. Can you explain how to retrieve lookup values in sharepoint list