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.
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.
-
you cannot do this form a webview
you should use an event for this, so you trigger in webview an event that belongs to Titaniumtake a look here( 3rd post )
http://developer.appcelerator.com/question/10671/webview-dom