开发者

jQuery live event on iPad...why doesn't it work?

开发者 https://www.devze.com 2023-01-08 21:13 出处:网络
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 wor

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.

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.

Thanks :)


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);

and when you add this later it works on the ipad

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

here is where I got my information

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


I had to use the jQuery .delegate event which seems to do the trick binding click to an element after an ajax call.


'cursor: pointer' for the perticular ID in css file works for me..

0

精彩评论

暂无评论...
验证码 换一张
取 消