Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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