为什么Appcelerator不会检测到事件被触发?

时间:2012-06-19 21:21:51

标签: javascript-events titanium appcelerator titanium-mobile

在我的HTML文件中,我有:

<html><head> 
<style>html{width: 320px; } body {padding: 0; margin: 0 auto; width: 320px;} img {left: 0; top: 0; display: block;}</style>

<script>
  Titanium.App.fireEvent('someEvent', {});
</script>
</head><body>
<a href="http://www.google.com" target="_blank">LINK!!!</a>
</body></html>

app.js,我有:

Ti.App.addEventListener('someEvent', function(e){
 alert("RECEIVED");

然而,当我使用index.html加载webview时,我的应用程序崩溃了。知道为什么会这样吗?

1 个答案:

答案 0 :(得分:2)

如果您使用的是Android模拟器2.3 ...有一个已知的错误,您无法在Webview中使用任何Titanium功能。谷歌拒绝解决影响appcelerator尝试做什么的问题。建议您在设备上尝试此部分。

它应该在2.2模拟器中工作正常,我认为3以上的所有内容

这是你的问题吗?