{"id":31,"date":"2024-02-03T10:47:49","date_gmt":"2024-02-03T09:47:49","guid":{"rendered":"https:\/\/solarxbike.se\/labbet\/code-snippets\/?p=31"},"modified":"2024-02-07T19:45:09","modified_gmt":"2024-02-07T18:45:09","slug":"display-json-in-html","status":"publish","type":"post","link":"https:\/\/solarxbike.se\/labbet\/code-snippets\/31\/display-json-in-html\/","title":{"rendered":"ChatGPT: Visa json i html"},"content":{"rendered":"<div id=\"json-container\"><\/div>\n<p><script>\n  document.addEventListener('DOMContentLoaded', function () {\n    fetch('https:\/\/yellotab.zendesk.com\/api\/v2\/tickets.json')\n      .then(response => response.json())\n      .then(data => {\n        \/\/ Display JSON data in the specified container\n        document.getElementById('json-container').innerHTML = JSON.stringify(data, null, 2);\n      })\n      .catch(error => console.error('Error fetching JSON:', error));\n  });\n<\/script><\/p>\n<pre><strong>K\u00e4lla<\/strong>: <a href=\"https:\/\/chat.openai.com\/c\/f5aff28b-9570-4f5a-b208-bbd204648355\">ChatGPT<\/a><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>K\u00e4lla: ChatGPT<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":""},"categories":[3],"tags":[12,10],"class_list":["post-31","post","type-post","status-publish","format-standard","hentry","category-fungerar-inte","tag-div","tag-html"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/solarxbike.se\/labbet\/code-snippets\/wp-json\/wp\/v2\/posts\/31","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solarxbike.se\/labbet\/code-snippets\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solarxbike.se\/labbet\/code-snippets\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solarxbike.se\/labbet\/code-snippets\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solarxbike.se\/labbet\/code-snippets\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":5,"href":"https:\/\/solarxbike.se\/labbet\/code-snippets\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":56,"href":"https:\/\/solarxbike.se\/labbet\/code-snippets\/wp-json\/wp\/v2\/posts\/31\/revisions\/56"}],"wp:attachment":[{"href":"https:\/\/solarxbike.se\/labbet\/code-snippets\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solarxbike.se\/labbet\/code-snippets\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solarxbike.se\/labbet\/code-snippets\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}