TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Deepak Upadhya
NA
34
2.5k
How to Display SharePoint Online365 List Items on non spsite
Sep 21 2018 8:04 AM
How to Display SharePoint Online 365 List Items on non - share point site , you can say a site built using html. how we can connect? I have tried using simple html page and REST API. its giving error as "Access Denied". Looks like I am missing something or i am using wrong methods. Please help
below is my code :
<html>
<head>
<script src=
"/jquery.min.js"
></script>
<script>
$(document).ready(
function
() {
function
executesearch(){
var
siteurl =
"https://abc.com/sites/space2/xyz/_api/lists/getbytitle('Pages')/Items"
;
$.ajax({
url: siteurl,
method:
"GET"
,
headers: {
"Accept"
:
"application/json; odata=verbose"
},
success:
function
(data) {
if
(data.d.results.length > 0 ) {
alert(data);
}
},
error:
function
(data) {
alert(
"Error: "
+ siteurl);
}
});
}
$(
"#search-button"
).off().click(
function
(e) {
executesearch();
});
});
</script>
</head>
<body>
<div
class
=
"test"
>
<button
class
=
"btnsearch"
id=
"search-button"
>
FIND CONTENT</button>
</div></body>
</html>
Reply
Answers (
5
)
unable to get the specific list/library contenttypes csom
How to Display Sharepoint list items on a html website