Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Activity indicator on links within a web view

By default, my web view shows an activity indicator when the window first loads, which is great.

I need to extend that so that once the first page in the web view loads, if I click a link inside the web view, the activity indicator shows while the next page loads.

I couldn't seem to find an example of that anywhere, but if there is example code, I'd love to see it.

Thanks in advance,

Peter

— asked July 15th 2010 by Peter janett
  • activity
  • indicator
  • webview
0 Comments

2 Answers

  • Accepted Answer

    Hi Peter,

    you can show an activity indicator when loading another page with:

    webview.addEventListener("beforeload", function(e)
    {
        // code
    }
    

    Then, when the page has finished loading you can hide the activity indicator with:

    webview.addEventListener("load", function(e)
    {
        // code
    }
    

    That should do the trick.

    — answered July 15th 2010 by Sean McEmerson
    permalink
    0 Comments
  • webview.addEventListener("beforeload", function(e)
    {

    showActivity();

    setTimeout(function() {

    hideActivity();

    }, 7000);

    });

    — answered November 8th 2013 by Tejpratap singh
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.