Results 1 to 7 of 7

Thread: Auto Refresh phonegap app

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    4

    Default Answered: Auto Refresh phonegap app

    Is there anyway to refresh an offline app every minute or given time?

  2. <script language="javascript" type="text/javascript">setTimeout("location.reload();",10000);</script>


    <meta http-equiv="refresh" content="60">

    there are two ways right there. these are done in your index.html or index.php pages

    or

    setTimeout("window.location.reload();",10000);

    hope that helps

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    What do you mean refresh?
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    4

    Default

    In this app I store local notifications on iPhone. If app is closed and any notification shows up, I open the app and badges and db are ok, but if app is opened nothing happens. So I need some function to refresh main view to update this badges and db.

  5. #4
    Sencha Premium Member
    Join Date
    Nov 2007
    Location
    Moore, Oklahoma
    Posts
    502
    Answers
    10

    Default

    window.location.href = window.location.href;

  6. #5
    Sencha User
    Join Date
    Nov 2011
    Posts
    4

    Default

    Actually I was using mystore.load() and a function to check any db modification instead window.location.href. But I think this will come handy. Anyways my first question still is: how can I execute this every minute?

    Thanks.

  7. #6
    Sencha Premium Member
    Join Date
    Nov 2007
    Location
    Moore, Oklahoma
    Posts
    502
    Answers
    10

    Default

    <script language="javascript" type="text/javascript">setTimeout("location.reload();",10000);</script>


    <meta http-equiv="refresh" content="60">

    there are two ways right there. these are done in your index.html or index.php pages

    or

    setTimeout("window.location.reload();",10000);

    hope that helps

  8. #7
    Sencha User
    Join Date
    Nov 2011
    Posts
    4

    Default

    Thanks! That's I was looking for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •