This is the first time I work with JSon, so pls dont be rude with me 🙂
I have this website.
http://msdn.microsoft.com/en-us/library/jj164022(v=office.15).aspx
and this javascript sample:
jQuery.ajax({
url: http:// site url/_api/web/lists,
type: "GET",
headers: {
"ACCEPT","application/json;odata=verbose",
"Authorization", "Bearer " + accessToken
},
})
The thing is I have a div called results and I would like to show the list names that the rest service returns me.
It’s hard to say exactly how to show the list in your div without knowing how the returned JSON is formatted. But the main idea is that you’ll need to add a success callback function to your jQuery.ajax() call in which you parse the returned data and insert it into your div. For example: