[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…. :/