Easily display JSON data locally or from API / URL in your HTML - no JavaScript knowledge required.
View Source Code On GitHub<script>
let YourJSONData = {
example: "hello",
example2: "world"
};
</script>
Create a <json>
tag with the attribute local-json
with your variable name of the JSON data - then you can access it like so using pure HTML. Example below -
<json local-json="YourJSONData">@{{example}} @{{example2}}.</json>
Instead of using a <json>
tag with the attribute local-json
use fetch-json
with a URL to JSON data.
Note: fetched JSON data will be returned inside of a nested JSON object called json
.
Example of usage below!
<json fetch-json="https://api.github.com/users/MarketingPipeline/repos"> All of MarketingPipeline's public repos - {{#json}} Repo title {{name}} <b>Description</b> {{description}} <b>Stars</b>: {{stargazers_count}} Repo URL <a href="{{url}}">Click to view!</a><br/>{{/json}}</json>