将Json数据转换为数组

问题描述:

我有一个问题我解释了我要做的事情我已经转换了json格式,如下所示:

I have a problem i explain what i have to do i have convert json format which is given below:

[
    {
        "Latitude": "-7.00786",
        "Longitude": "34.99805",
        "UserID": 0,
        "HTMLCode": "<p><h3>Jhony Jhony</h3><br/><i>t would be title, info on the missionary and then links for any social links they have.  So in backend if they DO NOT have a twitter account then that icon would disappear.  It only shows the icons if it exists and they put in the info in the administrator backend.\r\nFor "Get Their Updates".  It will ask for their email address and then email them a predetermined .pdf (which is set in admnistrator backend for that missionary).  Als</i><br/><i>Tanzania</i><br/><img src=/Content/SocialMediaImages/_facebook_btrix.png/><div id=div0 style=display:none><input type=text id=txt0 /><input type=button value=Submit class=btnGetUpdatesUsingEmail data-attr-id=#txt0 data-attr-UserId=0 /> </div><a href=0 class=GetUpdates>GetUpdates</a><p>"
    },
    {
        "Latitude": "46.91814",
        "Longitude": "25.62973",
        "UserID": 0,
        "HTMLCode": "<p><h3>Testing</h3><br/><i>Its a testing purposes only......</i><br/><i>Romania</i><br/><div id=div0 style=display:none><input type=text id=txt0 /><input type=button value=Submit class=btnGetUpdatesUsingEmail data-attr-id=#txt0 data-attr-UserId=0 /> </div><a href=0 class=GetUpdates>GetUpdates</a><p>"
    },
    {
        "Latitude": "29.54032",
        "Longitude": "83.51368",
        "UserID": 0,
        "HTMLCode": "<p><h3>Nayeem Mansoori</h3><br/><i>Description for testing</i><br/><i>China</i><br/><img src=/Content/SocialMediaImages/_facebook_btrix.png/><img src=/Content/SocialMediaImages/_googleplus_btrix.png/><div id=div0 style=display:none><input type=text id=txt0 /><input type=button value=Submit class=btnGetUpdatesUsingEmail data-attr-id=#txt0 data-attr-UserId=0 /> </div><a href=0 class=GetUpdates>GetUpdates</a><p>"
    }
]

我想将此格式更改为数组:

And i wanna change this format to array like:

 var locations = [[-7.00786, 34.99805, 0, '<p><h3>Jhony Jhony</h3><br/><i>t would be title, info on the missionary and then links for any social links they have.  So in backend if they DO NOT have a twitter account then that icon would disappear.  It only shows the icons if it exists and they put in the info in the administrator backend.For "Get Their Updates".  It will ask for their email address and then email them a predetermined .pdf (which is set in admnistrator backend for that missionary).  Als</i><br/><i>Tanzania</i><br/><img src=/Content/SocialMediaImages/_facebook_btrix.png/><div id=div0 style=display:none><input type=text id=txt0 /><input type=button value=Submit class=btnGetUpdatesUsingEmail data-attr-id=#txt0 data-attr-UserId=0 /> </div><a href=0 class=GetUpdates>GetUpdates</a><p>'], [46.91814, 25.62973, 0, '<p><h3>Testing</h3><br/><i>Its a testing purposes only......</i><br/><i>Romania</i><br/><div id=div0 style=display:none><input type=text id=txt0 /><input type=button value=Submit class=btnGetUpdatesUsingEmail data-attr-id=#txt0 data-attr-UserId=0 /> </div><a href=0 class=GetUpdates>GetUpdates</a><p>'], [29.54032, 83.51368, 0, '<p><h3>Nayeem Mansoori</h3><br/><i>Description for testing</i><br/><i>China</i><br/><img src=/Content/SocialMediaImages/_facebook_btrix.png/><img src=/Content/SocialMediaImages/_googleplus_btrix.png/><div id=div0 style=display:none><input type=text id=txt0 /><input type=button value=Submit class=btnGetUpdatesUsingEmail data-attr-id=#txt0 data-attr-UserId=0 /> </div><a href=0 class=GetUpdates>GetUpdates</a><p>']];

请帮帮我,我也谷歌搜索但没有任何结果..

please help me i was googling too but not any results..

这是使用 map()的简单方法:

var locations = $.map(json, function(v,i){
    return [[v.Latitude, v.Longitude, v.UserID, v.HTMLCode]];
});