[ 
https://issues.apache.org/jira/browse/CB-1846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13497105#comment-13497105
 ] 

Remzi Cavdar edited comment on CB-1846 at 11/14/12 1:58 PM:
------------------------------------------------------------

It also doesn't work if I use the example code:


    <script type="text/javascript" charset="utf-8">

    // Call onDeviceReady when Cordova is loaded.
    //
    // At this point, the document has loaded but cordova-2.2.0.js has not.
    // When Cordova is loaded and talking with the native device,
    // it will call the event `deviceready`.
    //
    function onLoad() {
        document.addEventListener("deviceready", onDeviceReady, false);
    }

    // Cordova is loaded and it is now safe to make calls Cordova methods
    //
    function onDeviceReady() {
        document.addEventListener("offline", onOffline, false);
    }

    // Handle the offline event
    //
    function onOffline() {
         
          alert("Er is geen internet verbinding!\nSchakel Wifi of 3G in");
    }

    </script>


http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#offline
                
      was (Author: remzicavdar):
    It also doesn't work if I use the example code:


    <script type="text/javascript" charset="utf-8">

    // Call onDeviceReady when Cordova is loaded.
    //
    // At this point, the document has loaded but cordova-2.2.0.js has not.
    // When Cordova is loaded and talking with the native device,
    // it will call the event `deviceready`.
    //
    function onLoad() {
        document.addEventListener("deviceready", onDeviceReady, false);
    }

    // Cordova is loaded and it is now safe to make calls Cordova methods
    //
    function onDeviceReady() {
        document.addEventListener("offline", onOffline, false);
    }

    // Handle the offline event
    //
    function onOffline() {
         alert("Er is geen internet verbinding!\nSchakel Wifi of 3G in");
    }

    </script>


http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#offline
                  
> Offline event doesn't work
> --------------------------
>
>                 Key: CB-1846
>                 URL: https://issues.apache.org/jira/browse/CB-1846
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.2.0
>         Environment: Samsung Galaxy S2 and Google Nexus 7
>            Reporter: Remzi Cavdar
>            Assignee: Joe Bowser
>             Fix For: 2.2.0
>
>
> The offline event doesn't work and I had said this before release, but you 
> guys wanted to release PhoneGap 2.2.0 
> This is my code:
> document.addEventListener("deviceready", onDeviceReady, false);
> function onDeviceReady() {
>       document.addEventListener("offline", function() {
>               alert("Er is geen internet verbinding!\nSchakel Wifi of 3G in");
>       }, false);
> }
> /* English: alert("No internet connection!\nPlease turn on Wifi or 3G");  */

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to