使用 Dashcode 移动项目时 Android 浏览器中的触摸事件不正确
我正在使用 Dashcode 开发 HTML/Javascript 移动 Web 应用程序。通常我不会使用这种所见即所得的东西,但我发现它是一个非常快速的开发过程。
不幸的是,目前我似乎无法让它在 Android 浏览器上运行。主显示屏会加载,所有正确的数据都会从网络服务中提取,但您无法按任何按钮来激活它。
我怀疑 Android 浏览器正在发送不同的 javascript 事件,而 Dashcode 对象未配置为拾取这些事件。
此外,adb logcat 调试器拒绝从模拟器上的浏览器输出任何日志消息,因此我很难解决这个问题。
所以我的问题是:有人可以帮助我找出我需要监视哪些事件,以便我可以迭代所有触摸处理程序并将它们复制到 android 事件,或者在这种情况下以任何其他方式提供帮助?
I'm developing an HTML/Javascript mobile web application using Dashcode. Normally I wouldn't use such WYSIWYG stuff, but I've found it a very rapid development process.
Unfortunately it seems like I can't get it to run on Android's browser currently. The main display loads and all the correct data is pulled from web services, but you cannot press on anything to activate it.
I suspect that the android browser is sending different javascript events, which the Dashcode objects are not configured to pick up.
In addition, the adb logcat debugger refuses to output any log messages from the browser on the emulator, and as such I'm having a very hard time sorting this out.
So my question is: Can someone help me find out what events I need to be watching for, so I can iterate over all the touch handlers and duplicate them for the android events, or offer help in any other way on this situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的 Dashcode 应用程序也遇到了同样的问题。
另一方面,我的 jqTouch 应用程序在 Android 浏览器上完美运行 - 与在 iPhone(Mobile Safari)上运行的方式完全相同。
这让我想知道:
jqTouch 注册点击/点击/任何用户事件的方式与 Dashcode 有何不同?
如果有人能回答这个问题,我们可能就成功了一半......
I ran into this exact same problem also with my Dashcode applications.
On the other, my jqTouch applications work on the Android broswer perfectly - exactly the same way they do on iPhone (Mobile Safari).
This made me wonder:
How does jqTouch register to click/tap/whatever user events differently than Dashcode?
If someone can answer this question we might be half way to the solution...
至少,关于 onClick 事件我遇到了类似的问题。尝试从部署文件夹中删除所有数据。我还使用内联样式来触发“onclick”方法,如下所示:
这对我在 iPhone 和 Android 2.1 设备(预安装的浏览器和 FF)上有效。希望有帮助...
With regard to, at least, onClick event I had similar problems. Try erasing ALL data from deploy folder. I also used inline style to fire 'onclick' method like this:
this worked for me on iPhone and Android 2.1 device (preinstaled browser and FF). hope that helps...
我刚刚解决了这个问题,认为我已经解决了。
问题出在 Dashcode javascript 框架的浏览器嗅探中。
在
Parts/core/core/base.js
中,第 47 行:在
Parts/core/views/Page.js
中,第 581 行:Dashcode 错误地将 Android 浏览器识别为移动设备Safari,因为它的用户代理看起来像:
Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
结果是 Dashcode 无法附加其 click 和 dblclick 事件侦听器。
将
Parts/core/core/base.js
的第 47 行更改为:I just wrestled with this and think I have it sorted.
The problem is in the Dashcode javascript frameworks' browser sniffing.
In
Parts/core/core/base.js
, line 47:In
Parts/core/views/Page.js
, line 581:Dashcode incorrectly identifies the Android browser as Mobile Safari, since it's user agent looks something like:
Mozilla/5.0 (Linux; U; Android 2.2; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
The result is Dashcode failing to attach its click and dblclick event listeners.
Changing line 47 of
Parts/core/core/base.js
to this fixes it: