0
我试图在jquerymobile listview中显示所有联系人。很抱歉,我只收到一个联系人列出/显示。 我使用的代码below.Thanks在Jquerymobile中显示联系人Listview(phonegap)
function onDeviceReady() {
// find all contacts with 'Bob' in any name field
var options = new ContactFindOptions();
options.filter="";
options.multiple=true;
var fields = ["displayName", "phoneNumbers", "photos"];
navigator.contacts.find(fields, onSuccess, onError, options);
}
// onSuccess: Get a snapshot of the current contacts
//
function onSuccess(contacts) {
for (var i=0; i<contacts.length; i++) {
if(null != contacts[i].phoneNumbers)
{
for(var j=0;j<contacts[i].phoneNumbers.length;j++)
{
$('.real').append("<li'><a><img src='foto/user.png'/><h4 >" + contacts[i].displayName +"</h4><p>"+ contacts[i].phoneNumbers[j].value +"</p></a> </li>").listview('refresh');
}
}
}
}
// onError: Failed to get the contacts
//
function onError(contactError) {
alert('onError!');
}
Searchng for the same issue ..你有没有找到解决方案呢?谢谢! – EranLevi
YES,删除“.listview('refresh');”。 –