denilson
denilson

Reputation: 1

Display Json file inside an html file

I am very new to Json but im trying to display a json file inside an html body.

my json file looks something like this

{ items: [
    {
        "thumb":"http://link/link.jpg",
        "title":"title of the link",
                  "link":"http://link.html",
        "popup":"false"
    },
    {
        "thumb":"http://link/link2.jpg",
        "title":"title of the link2",
                  "link":"http://link2.html",
        "popup":"false"
    },
    {
        "thumb":"http://link/link3.jpg",
        "title":"title of the link3",
                  "link":"http://link3.html",
        "popup":"false"
    }
]}

and i want have this to be displayed inside my html body document...any suggestions?ideas?

Thank you

Upvotes: 0

Views: 1107

Answers (1)

Bobby Jack
Bobby Jack

Reputation: 16048

To answer your question literally:

<iframe width="800" height="400" src="your-file.json"></iframe>

I'm not sure you really want that, though.

  • Does the JSON really exist in a file, or are you returning it as an HTTP response?
  • Are you really just using plain HTML, or is a server or client-side scripting language playing a role?
  • Do you want that plain text in your document, or are you looking to use the data in some way?

Upvotes: 1

Related Questions