iPad上的jQuery直播活动......为什么不起作用? [英] jQuery live event on iPad...why doesn't it work?

查看:115
本文介绍了iPad上的jQuery直播活动......为什么不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery在iPad上开发webapps,看起来jQuery live事件不起作用......当我使用SDK iPad模拟器并且现在我有iPad工作时就是这种情况在,它仍然是相同的(我希望它是一个模拟器故障)。在Web工具包上运行相同的代码构建工作正常。

I'm using jQuery to develop webapps on the iPad and it seems the jQuery live event doesn't work... This was the case when I was working with the SDK iPad emulator and now that I have the iPad to work on, its still the same (I was hoping it was an emulator fault). Running the same code on a web kit build works fine.

我只是想知道是否有其他人遇到此问题?如果有修复?或者如果是我?希望有人可以提供帮助,因为我的代码变得非常臃肿,不得不在ajax调用后重新点击点击等。

I'm just wondering if anyone else is having this problem? If there is a fix? or if it's me? Hoping someone can help as my code is becoming really bloated having to rebind clicks etc after ajax calls.

谢谢:)

推荐答案

问题出于某种原因,移动版Safari不会将点击事件附加到某些DOM元素,因此您必须手动附加它们。

The issue is for some reason mobile safari does not attach the click events to some DOM elements, So you have to manually attach them.

$('.header').live('click',get_location_input);

当你稍后添加它时,它可以在ipad上运行

and when you add this later it works on the ipad

<div class='header' onclick=''>Station Info</div>

这里是我获取信息的地方

http://skillfulness.blogspot.com/ 2010/11 / workaround-for-jquery-live-event.html

这篇关于iPad上的jQuery直播活动......为什么不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆