Ti.app.fireevent Not Working; Error Uncaught Typeerror: Cannot Read Property 'app' Of Undefined
I have a simple Titanium app which opens a webview, and loads a URL. I want the links to open in the default browser, not the app. I have some jQuery code which adds a click event
Solution 1:
As you mentioned that the webview is loading remote url. So Ti.*
or Titanium.*
are not available at your remote server.
What you can do is :
- Create a html file within the app and load the data via ajax and use
fireEvent
. - Load the data via
titanium http client
and useTi.Platform.openURL
accordingly.
Edit : Quote from Titanium WebView Docs
Remote Scripts
Scripts downloaded from remote web servers cannot access the Titanium namespace.
To interact with remote content, wait until the content is loaded, then use the evalJS method to execute a JavaScript expression inside the web view and retrieve the value of an expression.
Post a Comment for "Ti.app.fireevent Not Working; Error Uncaught Typeerror: Cannot Read Property 'app' Of Undefined"