Created
September 23, 2013 16:32
-
-
Save cliftonlabrum/6673204 to your computer and use it in GitHub Desktop.
Passing Data to a webView and back in Titanium.
This file contains hidden or 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