Titanium Community Questions & Answer Archive

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

Open a window from a webview

Hi!

I'm tryingo to open an new window when click on a div:

here's my code:

<script>

function local()
        {


        var win = null;
win=Titanium.UI.createWindow({url:"carte.js",title:"Carte",backgroundColor:'#fff',barColor:'#111'});
        Titanium.UI.currentTab.open(win,{animated:true});
        }
</script>

The function is lauched, but no result (tested with the code replaced by an alert)

How can I debug it?

Thanks;

Ivan.

— asked May 15th 2010 by Ivan Mathy
  • iphone
0 Comments

2 Answers

  • Accepted Answer

    If you search the history, i believe the solution is to add an event on your app, then trigger that event with fireEvent on that remote web url of yours, unfortunately, i don't think it's longer working for a remote url. At least not for iphone or ipad app.

    My solution is still the same but get around the remote url by adding a temporary webview on my app, hide it then assign that html content to another webview. Voila! i can now trigger that 2nd webview link to open new window. The temp html content is gathered from webview load event.

    — answered May 15th 2010 by Daniel Lim
    permalink
    0 Comments
  • you cannot do this form a webview
    you should use an event for this, so you trigger in webview an event that belongs to Titanium

    take a look here( 3rd post )

    http://developer.appcelerator.com/question/10671/webview-dom

    — answered May 15th 2010 by Dan Tamas
    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.