API Content

Topics - English

IdEnglish Topic

Topics - Spanish

IdSpanish Topic

Categories - English

IdEnglish Category

Categories - Spanish

IdSpanish Category

Code used to generate the above tables:


<table>
  <thead><tr><th>Id</th><th>English Topic</th></tr></thead>
  <tbody data-api-type="topic" data-api-lang="en" />
</table>

<table>
  <thead><tr><th>Id</th><th>Spanish Topic</th></tr></thead>
  <tbody data-api-type="topic" data-api-lang="es" />
</table>

<table>
  <thead><tr><th>Id</th><th>English Category</th></tr></thead>
  <tbody data-api-type="category" data-api-lang="en" />
</table>

<table>
  <thead><tr><th>Id</th><th>Spanish Category</th></tr></thead>
  <tbody data-api-type="category" data-api-lang="es" />
</table>

<script>
(function() {
  var tbodies = document.querySelectorAll('tbody[data-api-type][data-api-lang]'), t=0;
  function getContent () {
    var tbody = tbodies[t];
    var xhr = new XMLHttpRequest();
    var url="/myhealthfinder/api/v3/itemlist.json";
    url += "?type=" + tbody.dataset.apiType;
    url += "&lang=" + tbody.dataset.apiLang;
    xhr.open("GET", url);
    xhr.send();
    xhr.onload = function() {
      var tr, td;
      var response = JSON.parse(xhr.response);
      if (++t < tbodies.length) getContent();
      response.Result.Items.Item.forEach(function(item) {
        tr = document.createElement("tr");
        td = document.createElement("td");
        td.innerHTML = item.Id;
        tr.appendChild(td);
        td = document.createElement("td");
        td.innerHTML = item.Title;
        tr.appendChild(td);
        tbody.appendChild(tr);
      });
    };
  };
  if (tbodies.length > 0) getContent();
})();
</script>