title: How to get JSON data from the URL (REST API) to UI using jQuery or plain JavaScript?
body: <p>I have a URL "<code>http://localhost:8888/api/rest/abc</code>" which will give following json data. I wants to get this data in my UI using Jquery or java script. I'm trying this from couple of hours but I'm unable to resolve it. Please Suggest me few solutions which will help me to resolve this problem.</p>
  
  <pre><code>{
    "My-user": [
      {
        "link": [
          {
            "href": "http://localhost:8888/api/rest/abc/MI/CH",
            "rel": "self",
            "type": "application/my.My.My-user+xml",
            "title": "rln"
          },
          {
            "href": "http://localhost:8888/api/rest/cabin?MI=mi&amp;CH=ch",
            "rel": "some relation",
            "type": "application/my.My.My-cabin+xml",
            "title": "rln1"
          }
        ],
        "My-user-list": [
          {
            "name": "cuba",
            "Explanation": "bark"
          }
        ],
        "CH": "ch",
        "MI": "mi",
        "password": "xyz",
      },
      {
        "link": [
          {
            "href": "http://localhost:8888/api/rest/abc/DD/KN",
            "rel": "self",
            "type": "application/my.My.My-user+xml",
            "title": "rln"
          },
          {
            "href": "http://localhost:8888/api/rest/cabin?DD=dd&amp;KN=kn",
            "rel": "some relation",
            "type": "application/my.My.My-cabin+xml",
            "title": "rln1"
          }
        ],
        "My-user-list": [
          {
            "name": "Cuba1",
            "Explanation": "bark1"
          }
        ],
        "KN": "kn",
        "DD": "dd",
        "password": "xyz1",
      }
    ]
  }
  </code></pre>
  
  <hr>
  
  <p>I have tried Getjson which is not working out for me this is my code below Please correct me if the code is wrong.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
  $.getJSON('/api/rest/abc', function(data) {
      console.log(data);
  });
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>