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

Problem in accessing REST API through javascript in sp2013

$
0
0

I am trying to access list items the list items through REST in javascript. I use following code:

 

<input onclick="Call()" name="Button1" type="button" value="button" /><script type="text/javascript" src="../SiteAssets/Scripts/jquery.js"></script><script type="text/javascript" src="../SiteAssets/Scripts/jquery-1.7.2.js"></script><script type="text/javascript" src="../SiteAssets/Scripts/jquery-1.7.2.min.js"></script><script  type="text/javascript"> 
function test()
{

}                
ExecuteOrDelayUntilScriptLoaded(test,'sp.js');
</script><script >
function Call()
{
var appweburl = 'https://microsoft.sharepoint.com/teams/CCG_Tier2_Support';

var executor = new SP.RequestExecutor(appweburl);
                executor.executeAsync(
                    {
                        url:
                            appweburl +"/_api/SP.AppContextSite(@target)/web/lists?@target='" +
                            'RESTDemo' + "'",
                        method: "GET"}
                );



}
jQuery.ajax({
url: 'https://microsoft.sharepoint.com/teams/CCG_Tier2_Support',
type: 'GET'
})

I have inherited the page from default master page.

Here I am getting an error that object does not support thi property when try to access SP.RequestExecutor().

Can someone tell me the problem? 



 

Viewing all articles
Browse latest Browse all 25064

Trending Articles



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