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开发者_C百科.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
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?
精彩评论