Forked from cliftonlabrum/dataToFromWebViewTitanium.js
Last active
August 29, 2015 14:21
-
-
Save EdwardNavarro/972af645eeac119aae85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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