incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Maj <...@adobe.com>
Subject Re: Bug in cordova.js boot mechanism
Date Sun, 22 Apr 2012 18:26:24 GMT
Issue 499 (https://issues.apache.org/jira/browse/CB-499) described this
exact problem.

It has been fixed a few days ago
(http://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=commit
;h=2a8cdb98b764fcdd513d049ea5a35d95c3a119e2)

If you pull the latest cordova-js master, rebuild the JS and swap that in,
it should fix your issue.

On 4/22/12 10:00 AM, "Robert Hoffmann" <hoffmann@cbio.mskcc.org> wrote:

>Hi,
>
>We use cordova with GWT (on iOS) and we ran into a situation where the
>1) "document.addEventListener('DOMContentLoaded', function()..." in the
>boot sequence is called after the event has already fired
>2) BUT the document.readyState is NOT YET 'complete' but 'loaded'
>
>CURRENT code in cordova.js
>>>
>            boot: function () {
>                //---------------
>                // Event handling
>                //---------------
>
>                /**
>                 * Listen for DOMContentLoaded and notify our channel
>subscribers.
>                 */
>                document.addEventListener('DOMContentLoaded', function() {
>                    alert("loaded");
>                    channel.onDOMContentLoaded.fire();
>                }, false);
>                if (document.readyState == 'complete') {
>                    //alert("ready");
>                  channel.onDOMContentLoaded.fire();
>                }
><<
>
>thus I suggest to change it too
>
>>>
>            boot: function () {
>                //---------------
>                // Event handling
>                //---------------
>
>                /**
>                 * Listen for DOMContentLoaded and notify our channel
>subscribers.
>                 */
>                document.addEventListener('DOMContentLoaded', function() {
>                    alert("loaded");
>                    channel.onDOMContentLoaded.fire();
>                }, false);
>                if (document.readyState == 'complete' ||
>document.readyState == 'loaded') {
>                    //alert("ready");
>                  channel.onDOMContentLoaded.fire();
>                }
><<
>
>
>This seems to affect different target platforms, at least iOS and android.
>
>Best wishes,
>
>Robert


Mime
View raw message