title: How to use _spPageContextInfo in sharepoint Application
body: <p>I am working on SharePoint RESTful API using JavaScript. when using <strong>_spPageContextInfo</strong> it doesn't work. </p>
  
  <p>Error: Uncaught ReferenceError: _spPageContextInfo is not defined </p>
  
  <p>here is code i used</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  </code></pre>
  
  <p>
      </p>
  
  <pre><code>&lt;script src="../Scripts/jquery-1.8.2.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $.getJSON(_spPageContextInfo.webServerRelativeUrl + "/_api/web/currentuser",
              function (data) {
                  $("#message").text('hello' + data.d.Title);
              });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>...</p>