Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3630

How to use _spPageContextInfo in sharepoint Application

$
0
0

I am working on SharePoint RESTful API using JavaScript. when using _spPageContextInfo it doesn't work.

Error: Uncaught ReferenceError: _spPageContextInfo is not defined

here is code i used

<html xmlns="http://www.w3.org/1999/xhtml">

<script src="../Scripts/jquery-1.8.2.min.js"></script><script type="text/javascript">    $(document).ready(function () {        $.getJSON(_spPageContextInfo.webServerRelativeUrl +"/_api/web/currentuser",            function (data) {                $("#message").text('hello'+ data.d.Title);            });    });</script>

...


Viewing all articles
Browse latest Browse all 3630

Trending Articles