Titanium Community Questions & Answer Archive

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

fireEvent from remote URL on iphone

Is it no longer possible for remote URLs (ie: myserver.com/myfile.html) to trigger fireEvents in iPhone?

What I am doing is this:

<a href="#" onclick="alert(1);Ti.App.fireEvent('testEvent');alert(2)">Meh</a>

From the remote webview it triggers the first alert but not the second, locally it works fine. Is this an iPhone limitation?

— asked May 18th 2010 by JT Jankowiak
  • fireevent
  • iphone
0 Comments

2 Answers

  • To get around remoteURL issue like this, i used a temp webview to hold the html content and create another webview, assign that content to the new webview.

    var tempweb = Ti.UI.createWebView({url:'remoteurl.html'});
    storeweb.hide();
    win.add(storeweb);
    
    storeweb.addEventListener('load',function(e){
    var temphtml = e.source.html;
    
     var winweb = Ti.UI.createWebView({
                width:'100%',
                height:'100%'
    });
    
     winweb.html = temphtml;
    
    })
    
    — answered May 18th 2010 by Daniel Lim
    permalink
    0 Comments
  • we have write the code in html5 then access the link on titanium web view then we have able to access the camera in iPhone not Android…Any one please help me

    — answered August 22nd 2015 by Dharma rao
    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.