title: How to call url in javascript?
body: <p>I´m creating frontend for app and i need to call api function. I've got a url from api, which gives me json data like this:</p>
  
  <pre><code>{ "id": 1, "name": "First Like", "description": "Like at least 1", "image": "images/badges/FIRST_LIKE" }
  </code></pre>
  
  <p>I need to call some of those items in my website. </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
              //url to call http://eclipsewildflyserver-gobanit.com/rest/something/id=1 
          function getList(){
  
             var name = url.getItem("description");
  
         document.getElementById("name").innerHTML = name.toString();
  
              }
  </code></pre>
  
  <p>I know im doing this completely wrong, and its my first atempt to do something like this, so I would really apreciate the help. Where should and how should I add url to code so i can pick a items i need? Thanks</p>
  
  <p>EDIT: So i tried to replace with the ideas you gave me, and its still not working. Can anyone tell me what am I doing wrong?</p>
  
  <pre><code>    &lt;script type = "texxt/javascript" src="https://code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" language="javascript"&gt;
  
  
  &lt;head&gt;
   $.getJSON('http://eclipsewildflyserver-gobanit.rhcloud.com/AssignToolWebApp/rest/id=1', function (data) {
                  var name = data;
                  document.getElementById("name").innerHTML = name.toString();
  
              });
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload=getList()&gt;
  &lt;div id="TopHeader"&gt;
      &lt;div id="header" class="container"&gt;
          &lt;div id="menu"&gt;
              &lt;ul&gt;
                  &lt;h1 id="name"&gt;&lt;/h1&gt;
              &lt;/ul&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt; 
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>Just trying to write a JSON string to page. Not working. I guess I´m doing something wrong.</p>