Answered by:
Call REST share point in asp.net by javascript

Question
-
Hello,
I write the following JavaScript in asp.net to call Rest share point :
$.ajax({
type: 'GET',
headers: {
'accept': 'application/json;odata=verbose'
},
url: "http://server/sites/Dhofar/en-us/_api/web/lists/GetByTitle('MenuList')/items?$select=Title",
success: function (data) {
console.log(data);
}
});I get the following error :
XMLHttpRequest cannot load http://server:9090/sites/Dhofar/en-us/_api/web/lists/GetByTitle('MenuList')/items?$select=Title. No 'Access-Control-Allow-Origin' header is present on the requested resource.
How Can I solve it ?
ASk
Answers
-
-
Hi Himo,
CHeck this link for step by step procedure for calling Rest API. THe below example demonstartes accessiong list items.
Please remember to click 'Mark as Answer' on the answer if it helps you
- Marked as answer by JasonGuo Sunday, July 6, 2014 1:32 PM
All replies
-
-
Hi Himo,
CHeck this link for step by step procedure for calling Rest API. THe below example demonstartes accessiong list items.
Please remember to click 'Mark as Answer' on the answer if it helps you
- Marked as answer by JasonGuo Sunday, July 6, 2014 1:32 PM