Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8215455
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:47:30+00:00 2026-06-07T11:47:30+00:00

has anyone experienced something like this. I have my callback functions and implement them

  • 0

has anyone experienced something like this. I have my callback functions and implement them like this.

function onBodyLoad()
    {
        $('.loading').bind('click',function(){
                           console.log("loading screen should show now");
                           $('#teaserslider').hide();
                           $('#resultslider').hide();
                           $('#loading-screen').show();
        })
        document.addEventListener("deviceready", onDeviceReady(), false);


    }


    function onDeviceReady()
    {
        $('#loading-screen').hide();
        setUpDatabase();
        document.addEventListener("online", deviceIsOnline, false);
    }

    function deviceIsOnline(){
        alert("Im online!");
        if (true){
            persistResultHistory();
        }

    }

Connected to Wi-Fi, I get the (“Im online!”) pop up 3 times. I searched my whole project, it only gets invoked here. So why 3 times? Also, when I switch on the airplane-mode without any connection to the internet, I get the pop-up 1 time. Anyone has experienced similar behavior?
Any help greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:47:33+00:00Added an answer on June 7, 2026 at 11:47 am

    You are calling the method immediately instead of giving reference of the method, so replace:

    document.addEventListener("deviceready", onDeviceReady(), false);
    

    With

    document.addEventListener("deviceready", onDeviceReady, false);
    

    Also put the addEventListener() outside of the onBodyLoad() function and make it run immediately.

    Full source code here – https://gist.github.com/3077171

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

has anyone else experienced this . I have SP1 but i have to kill
Has anyone else experienced this? I have uninstalled and reinstalled TortoiseSVN as well as
Has anyone done something like this? How? I'm just starting a project that will
Has anyone experienced this issue - Blackberry stops responding to javaloader -usb after a
I would like some advice from anyone experienced with implementing something like pessimistic locking
I have csv file with a line that looks something like this: ,,,,,,,,,, That's
I have a python program that does something like this: Read a row from
I have an array of objects in JavaScript. I would like to sort them
Does anyone have experience / insight re: decoupling jquery / sizzle? this is for
Has anyone had experience using SSL with net.tcp binding in WCF? Ive read its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.