作者:手机用户2502859861 | 来源:互联网 | 2023-05-19 18:23
iamdevelopinghybridapplicationbyusingintelxdkandjquerymobileframeworkforUI.iamtrying
i am developing hybrid application by using intel xdk and jquerymobile framework for UI. i am trying to get json data from url and display it into listview. i already got json data from url but i don't know how to display those data in listview
我正在使用intel xdk和jquerymobile框架为UI开发混合应用程序。我试图从URL获取json数据并将其显示到listview中。我已经从url获取了json数据,但我不知道如何在listview中显示这些数据
This is my json data
这是我的json数据
{
"nl_wu":[
{
"id":"42",
"year":"2015",
"month":"jan",
"title":"newsletter",
"file":"http://school.com/sample.pdf"
},
{
"id":"39",
"year":"2015",
"month":"jan",
"title":"imagetest",
"file":"http://school.com/sampleimage.jpg"
}
]
}
This is json retrieving function
这是json检索功能
function showsmsmessage(){
var i;
var out ="";
var json;
var arr ;
var xhr = new XMLHttpRequest();
xhr.open("GET", "URL", false);
xhr.Onload= function(){
if(xhr.status == 200)
{
var json_string = xhr.responseText;
json = eval ("(" + json_string + ")");
var s = JSON.stringify(json);
arr = $.parseJSON(s);
for(i=0;i
this is my html code for displaying json data in listview
这是我用于在listview中显示json数据的html代码
i want to display title from json in my listview (dynamically). i am getting title from json and just display it in alert message but i need to display in my listview. In my html code i just create one listview with static item.
我想在listview中显示json的标题(动态)。我从json获得标题,只是在警报消息中显示它,但我需要在我的列表视图中显示。在我的HTML代码中,我只使用静态项创建一个列表视图。
My Question:-
1) how to display json data(title) in my listview
1)如何在listview中显示json数据(标题)
2) if i click the data item, particular pdf file or image file should download by using file path from json and display it in our app (i have file path in my json)
2)如果我点击数据项,应该使用json的文件路径下载特定的pdf文件或图像文件,并将其显示在我们的应用程序中(我的json中有文件路径)
could you please tell me how to display json data(title) in my listview dynamically
你能告诉我如何动态地在listview中显示json数据(标题)吗?
2 个解决方案