Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EdwardNavarro/972af645eeac119aae85 to your computer and use it in GitHub Desktop.
Save EdwardNavarro/972af645eeac119aae85 to your computer and use it in GitHub Desktop.
//Send data to webView in Titanium
var timeGraph = Ti.UI.createWebView({ url:'graphs/timeGraph.html', touchEnabled:true });
timeGraph.addEventListener('load', function(){
Ti.App.fireEvent('graphCareer', series);
});
<!-- Receive data in webView -->
<script type="text/javascript">
Ti.App.addEventListener('graphCareer',function(series){
alert(series);
});
</script>
<!-- Send data back to Titanium from the webView -->
<script type="text/javascript">
Ti.App.fireEvent('graphPopup', {a:data1, b:data2, c:data3 });
</script>
//Receive data from webView in Titanium
Ti.App.addEventListener('graphPopup', function(data){
Ti.API.info(data.a+' / '+data.c+' / '+data.c);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment