Javascript PhoneGap-DOM不';onDeviceReady事件后的t更新

Javascript PhoneGap-DOM不';onDeviceReady事件后的t更新,javascript,jquery,events,dom,cordova,Javascript,Jquery,Events,Dom,Cordova,PhoneGap中的ondevicerady事件有问题 当我的应用程序启动时,我使用jQuery.text()动态填充一些字段,然后启动一个动画进度条 在不侦听事件的情况下测试它(但在app.initialize()中编写代码),一切正常 使用事件,代码隐藏可以工作,但DOM不会更新 我尝试使用jQuery代码行:$('.page').trigger('refresh') 它工作得很好,除了动画进度条 jQuery.trigger('refresh')是干净的解决方案吗?(我想没有!) 我怎样才

PhoneGap中的
ondevicerady
事件有问题

当我的应用程序启动时,我使用jQuery.text()动态填充一些字段,然后启动一个动画进度条

在不侦听事件的情况下测试它(但在
app.initialize()
中编写代码),一切正常

使用事件,代码隐藏可以工作,但DOM不会更新

我尝试使用jQuery代码行:
$('.page').trigger('refresh')
它工作得很好,除了动画进度条

jQuery.trigger('refresh')
是干净的解决方案吗?(我想没有!)

我怎样才能解决这个问题

谢谢大家!


代码如下:

var app = {

    dateP: "",

    initialize: function (date) {
        dateP = date;
        //this.actions();
        this.bindEvents();
    },

    bindEvents: function () {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },

    onDeviceReady: function () {
        app.receivedEvent('deviceready');
    },

    receivedEvent: function (id) {
        if (id == 'deviceready') this.actions();
    },

    actions: function () {

        var date = this.getDate();

        var id = this.getDayId(date);
        var perc = Math.ceil((id / 365) * 100);

        this.shareButtonInizialize();
        this.fillDivs(new Date());

        $("#mainDayCounter").text("Giorno #" + this.getDayId(date));
        $("#dayCounter").text("Giorno #" + this.getDayId(date));

        this.setBar(perc);
    },

    setBar: function (perc) {
        $("#main-page #probar").attr({
            "data-pro-bar-percent": perc,
                "data-pro-bar-text": perc + "% \xa0"
        });

    },

    /* OTHER FUNCTIONS */

}

我不明白你的问题。is
$(“#mainDayCounter”).text(“Giorno”+this.getDayId(date))不更新DOM?是!这就是问题所在!设置文本后,我使用方法
$(“#mainDayCounter”).show()
求解!非常感谢。