title: Attach a Sitecore item url to a JavaScript variable
body: <p>I'm still learning Sitecore at the moment, and what I want to do is get the urls for several pages in a Sitecore site and use them to set some URLs in JavaScript.</p>
  
  <p>This the JavaScript I have set up:</p>
  
  <pre><code> &lt;script&gt;
        var page_data = {
            residentialUrl: '[Sitecore page link]',
            airportsUrl: '[Sitecore page link]',
            universitiesUrl: '[Sitecore page link]',
            officesUrl: '[Sitecore page link]',
            tunnelsUrl: '[Sitecore page link]',
            hospitalsUrl: '[Sitecore page link]',
            sportsUrl: '[Sitecore page link]',
            publicSafteyUrl: '[Sitecore page link]',
            governmentUrl: '[Sitecore page link]'
        }
    &lt;/script&gt;
  </code></pre>
  
  <p>It does work if you put a url inside single quotes for each url variable. But What I want is to put in the url of a Sitecore item for each url variable. I know how to get Sitecore item urls but I'm not sure how I would use them in this instance to set the url variables above? I don't want to have to hard-code the links in. I want them to be pulled from fields in Sitecore. Is there a way to do this?</p>