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>
...
you can try this code with Angular JS and SharePoint Javascript Object Model:
You can refer to this blog for step by step instruction in developing Angular JS with SharePoint Javascript Object Model.
Please click here for the blog link.
You can probably use as below.
To get current user logged in ::