tags:

views:

40

answers:

1

hi, 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

A: 

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?
Bobby Jack
Thanks Bobby!!!, Yes the Json file really exisit in same dir as my html file and its a plain html except i have <img id="navLeft" src="link/navleft.jpg" style="display:none;" onClick="scrollDivLeft()"/> to have it scroll left and right. I dont know if this help. But what should happen is i will have a frame inside my html file that will parse the json file and display a slide show of links and thump size images to scroll left and right :)
denilson