我正在尝试制作一个脚本,用于更新验证码图像,该图像是通过live()函数加载的...它可以工作,但它只会更新图像1次在firefox,2在safari上的时间...我如何使这个工作多次?jquery .live()点击多次
的jQuery 1.4.2代码
相关部分:
/* captcha image change */
var rand = Math.random();
$('a.captcha_refresh').live('click', function() {
$('img.captcha').attr("src", 'captchashow.php?sid=' + rand);
});
感谢, BRM
作为一个侧面说明,你可能需要使用'委托()',而不是'活()'。速度有点快。 – 2010-06-01 12:45:52