donglan6967 2012-06-15 15:06
浏览 42

原生应用程序在iOS中模拟但在Android中不能模拟 - 它是JS吗?

I am trying to make a native app using phonegap and jqm. When I test my app in DW and emulate it with xcode everything seems to work fine. The problem arises when I try to emulate the app for Android.

The static HTML elements render fine but the dynamic elements do not render in Android. Here is the HTML that I am trying to render using javascript:

// JavaScript Document
//var serviceURL ="http://localhost/UnitedTrackClub/";
$(document).ready(function(e) {

var schedule;

$('#scheduleListPage').bind('pageinit', function(event) {
getScheduleList();
});

function getScheduleList() {
$.getJSON(serviceURL + 'get_schedule_hdr.php', function(data) {
    $('#scheduleList li').remove();
    schedule = data.items;
    $.each(schedule, function(index, employee) {
        $('#scheduleList').append('<li><a href="scheduledetail.html?id=' + employee.Duration + '">' +
                '<h4>' + employee.Event_Date + ' ' + employee.Meet_Name + '</h4>' +'</a></li>');

    });
    $('#scheduleList').listview('refresh');

});
}
});

Does anyone have any suggestions?

Thanks

  • 写回答

1条回答 默认 最新

  • dtkp51520 2012-06-15 17:43
    关注

    To me looks like it prints the HTML before to get the data, I found that the native jQuery $.ajax() works better than getJSON in JQMobi so i would do like:

    $.ajax({
        url      : serviceURL + 'get_schedule_hdr.php',
        dataType : 'jsonp',
        crossDomain: true,
        success  : function(data) {
        $('#scheduleList li').remove();
        schedule = data.items;
        $.each(schedule, function(index, employee) {
        $('#scheduleList').append('<li><a href="scheduledetail.html?id=' + employee.Duration + '">' +
                '<h4>' + employee.Event_Date + ' ' + employee.Meet_Name + '</h4>' +'</a></li>');
    
    });
    $('#scheduleList').listview('refresh');
        }
    
    });
    

    But I didn't really check your code

    评论

报告相同问题?

悬赏问题

  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献