Titanium Community Questions & Answer Archive

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

How do you access the titanium api via a webview?

How do you access the titanium api via a webview?

When I do this in my app.js

var webView = Titanium.UI.createWebView({url:'index.html'});
var appWin = Titanium.UI.createWindow({fullscreen: true });
appWin.add(webView);
appWin.open();

And then put this is index.htm

<script>
alert(Titanium.Filesystem);
</script>

I get this… "undefined"

Is it possible to use the API in webview?

Hope so!

— asked May 9th 2010 by Justin Vincent
  • api
  • webview
0 Comments

3 Answers

  • You can use Titanium.App.fireEvent() and Titanium.App.addEventListener() to fire custom events.

    I recommend checking out the Kitchensink example.

    — answered May 9th 2010 by Richard Venneman
    permalink
    0 Comments
  • Lets say I wanted to save some data to the filesystem from within my web view, how would I do that?

    I don't quite get how to do that by looking at the kitchen sink exampes.

    Thx for your help! :)

    — answered May 9th 2010 by Justin Vincent
    permalink
    0 Comments
  • Take a look at this post to see how I set some properties from webview to titanium ( 3rd post , where I put some samples).

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

    — answered May 10th 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.