Skip to content

Instantly share code, notes, and snippets.

@zaru
Created May 25, 2012 06:47
Show Gist options
  • Select an option

  • Save zaru/2786236 to your computer and use it in GitHub Desktop.

Select an option

Save zaru/2786236 to your computer and use it in GitHub Desktop.
An event is ignited from remote HTML to TitaniumMobile.
var web = Ti.UI.createWebView({
url:'http://www.example.com/event.html'
});
web.addEventListener('error', function (e) {
if (/NSErrorFailingURLKey=custom:(\S+), /.test(e.message)) {
var data = RegExp.$1;
alert(Ti.Network.decodeURIComponent(data));
}
});
<script>
jQuery(function(){
jQuery('#click').click(function(){
location.href = 'custom:hogehoge';
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment