English 中文(简体)
将 json 数据转换为 html? [关闭]
原标题:what is a good library or plugin to render json data into html ? [closed]

我们不允许为软件库、辅导、工具、书籍或其他场外资源寻求建议的问题。 您可以编辑问题, 以便用事实和引用来解答问题。

Closed 3 years ago.

我打电话来取Json的数据。我得到的是这样的信息:

{
    "footerPkg": [
        {
            "hotelRoomPrice": 100,
            "idHolidayPackage": 1,
            "OriginCity": "New York",
            "itineraryHeader": "Trip to New York",
            "name": "Holiday Package 1"
        },
        {
            "hotelRoomPrice": 50,
            "idHolidayPackage": 1,
            "OriginCity": "Los Angeles",
            "itineraryHeader": "Amazing Los Angeles",
            "name": "Holiday Package 2"
        }
    ]
}

我必须像这样显示这个json阵列数据 :

"https://i.sstatic.net/WMHI3.png" alt="包"/ >

是否有一种 < 坚固的> 配制引擎 < / 坚固 > 或其他技术, 我可以指定像我这样适用于其他 html 元素的 json 参数的 cs 和其他 html 符号?

像这样的东西 这将是伟大的:

(假设碎片-1是数组中每个元素的代号)

data = array[0];
    <div id="fragment-1">
             <table><tr>
            <td><img src= data.image.path  alt="${data.image.altText}" title="${data.image.title}">
            <div id="overlaytextlistinglayout">
            <b><a>data.itineraryHeader</a></b><br>
            <br><a style="color: #000000 ">data.name</a>
    </div>
最佳回答

我最后使用"http://mustache.github.com/" rel="没有跟随无悔者">> mustache ,

@Jon Friscics:想要将@Jon Friscics 评论作为答案,

问题回答

这对你们来说也许是件好事:http://weblogs.asp.net/scottgu/archive/2010/05/07/jquery-templates-and-data-linking-and-microft-slinking-to-jquery.aspx





相关问题
JQuery/MVC Search Issue

I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...

jQuery quicksearch plug-in tinkering with JSON

I ve implemented the quicksearch plugin by Rik Lomas and I love it for an application in a custom CMS I m building. I was wondering though, since I m going to have a bizillion items in the table if ...

JSON with classes?

Is there a standardized way to store classes in JSON, and then converting them back into classes again from a string? For example, I might have an array of objects of type Questions. I d like to ...

PHP json_decode question

i m trying to use json_decode to combine a few json objects and then re-encode it. my json looks like: { "core": { "segment": [ { "id": 7, "...

Converting JSON data to Java object

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson(). Below is an example of what the string ...

热门标签