Skip to content

Instantly share code, notes, and snippets.

@rajubd49
Created April 16, 2015 10:04
Show Gist options
  • Save rajubd49/32b5d5ba5fc3e624a607 to your computer and use it in GitHub Desktop.
Save rajubd49/32b5d5ba5fc3e624a607 to your computer and use it in GitHub Desktop.
Fire an event from local HTML - Appcelerator Titanium
var win = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var webView = Ti.UI.createWebView({
url:'/localHtml.html',
backgroundColor:'transparent'
});
win.add(webView);
Ti.App.addEventListener("appC", function(e) {
var win1 = Titanium.UI.createWindow({
backgroundColor:'green'
});
win1.open();
});
win.open();
/*
localHtml.html
<html>
<head>
<title>Local HTML</title>
<link rel="stylesheet" type="text/css" href="local.css"/>
<script src="local.js"></script>
</head>
<body>
<a href="" onclick='Ti.App.fireEvent("appC", {}); return false;'>www.appcelerator.com</a>
</body>
</html>
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment