Titanium Community Questions & Answer Archive

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

[iphone] Webview Event for Mail

Hi,

I have a WebView with different links (Telephone, mails, and URL)

I wrote this code, which is working BUT just ONE time :

function load()
        {

            var mail = document.getElementsByClassName("mail");

            for(var m=0; m<mail.length;m++){
                mail[m].addEventListener("click",function(e){

                    Ti.API.info("clique HTML "+e.target.innerHTML);

                    Ti.App.fireEvent('mail',{target:e.target.innerHTML});

                },false);    

            }  

            var atonis = document.getElementById("atonis"); 

            atonis.addEventListener("click",function(e){

                    Ti.App.fireEvent('atonis');

                },false);  

        }

And when a i click on one link all is OK (i have my EventListener in the main App)

So, what can i do for make this code works all the time ? (If i click on one mail adress, i expect to click on another link….)

Thank you for Help ;)

PS : i tried to see how to bind events on Javascript, but i found nothing…. :/

— asked November 18th 2010 by Vivien Brissat
  • eventlistener
  • iphone
  • mails
  • webview
1 Comment
  • can you post the event code? Are the event actually getting fired?

    — commented November 18th 2010 by Aaron Saunders

0 Answers

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.