jQuery的移动浏览器:on()失败 [英] JQuery for mobile safari: on() fails

查看:105
本文介绍了jQuery的移动浏览器:on()失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为移动网页更改动态生成的DOM元素上的某些类. 我通常的方法,jquery on()无法正确接收事件.

I'm trying to change some classes on dynamically generated DOM elements for a mobile web page. My usual method, the jquery on() doesn't pick up the events properly.

我的备份"delegate()"也不起作用.

我正在使用JQuery版本"http://code.jquery.com/jquery-1.7.min.js"

I'm using JQuery version "http://code.jquery.com/jquery-1.7.min.js"

推荐答案

解决方案是将onclick =''添加到div元素.不知道为什么这样有效,但确实如此. –

The solution was to add onclick='' to the div element. Not sure why that worked, but it did. –

这篇关于jQuery的移动浏览器:on()失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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