cordova-1.6.0 + jquery $(document).bind("deviceready".. no work

1,010 views
Skip to first unread message

Ken OKABE

unread,
Apr 12, 2012, 12:12:47 AM4/12/12
to phon...@googlegroups.com
cordova-1.6.0 + jquery $(document).bind("deviceready"
I've got an error:
[INFO] Error in success callback: NetworkStatus0 = TypeError:
'undefined' is not an object
-----
With Phonegap1.4 or 1.5, I have been OK with the code below, but now I stuck.
Anyone has an idea? Thanks.

<html>
<head>
<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no;"/>
<meta charset="utf-8">

<script type="text/javascript" charset="utf-8"
src="js/cordova-1.6.0.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript">

$(document).ready(function()
{
alert("this Alert fires OK");

$(document).bind("deviceready", function()
{
alert("Got the Error and this Alert Never fires");
});

});

</script>

</head>
<body>
<p id="deviceProperties" style="font-size: 20px"></p>
</body>
</html>

Shazron

unread,
Apr 12, 2012, 1:41:30 AM4/12/12
to phon...@googlegroups.com
what version of jQuery?

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

JB_APP

unread,
Apr 12, 2012, 9:19:53 AM4/12/12
to phon...@googlegroups.com
Hello,
I am having the same error message.
I tried it first with jquery 1.4.3 and then updated to jquery 1.7.2 but still having the error message "[INFO] Error in success callback: NetworkStatus0 = TypeError:

Moisés Gramary Barbosa

unread,
Apr 12, 2012, 12:02:53 PM4/12/12
to phon...@googlegroups.com
Hello, I had the same problem with the upgrade from 1.5 to 1.6...

After a long day I found that that deviceready event begins a little "freak", try changing:

    $(document).bind("deviceready", function()

    {
        //code
    });

by:

    document.addEventListener("deviceready", function()

    {
        //code
    }, false);

It worked for me, even so, the most weird thing is that other events like touchmove or orientationchange still works with $( document ).bind; even $( document ).ready function works....

Appears to fail only with deviceready PG/CV event....

Any explanation?

JB_APP

unread,
Apr 12, 2012, 8:40:26 AM4/12/12
to phonegap
I have the same error message using cordova 1.6 + jquery.
I first used jquery 1.4.3 getting the error message. After an update
to jquery 1.7.2 I still get the error [INFO] Error in success
callback: NetworkStatus0 = TypeError:
'undefined' is not an object

Thanx for any good ideas how to fix it!

Shazron

unread,
Apr 12, 2012, 4:50:19 PM4/12/12
to phon...@googlegroups.com
Can you guys file an issue so it can be tracked and you notified?
We'll look at it.
https://issues.apache.org/jira/browse/CB

Moisés Gramary Barbosa

unread,
Apr 12, 2012, 5:17:07 PM4/12/12
to phon...@googlegroups.com
Already created at:  https://issues.apache.org/jira/browse/CB-491 


El jueves, 12 de abril de 2012 22:50:19 UTC+2, Shazron Abdullah escribió:
Can you guys file an issue so it can be tracked and you notified?
We'll look at it.
https://issues.apache.org/jira/browse/CB

On Thu, Apr 12, 2012 at 5:40 AM, JB_APP <in...@images-words.de> wrote:
> I have the same error message using cordova 1.6 + jquery.
> I first used jquery 1.4.3 getting the error message. After an update
> to jquery 1.7.2 I still get the error [INFO] Error in success
> callback: NetworkStatus0 = TypeError:
> 'undefined' is not an object
>
> Thanx for any good ideas how to fix it!
>
> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to

> phonegap+unsubscribe@googlegroups.com

Reply all
Reply to author
Forward
0 new messages