jQuery“返回假"适用于1.6版,但不适用于1.6.1版(rails 3) [英] jQuery "return false" works in version 1.6 but not 1.6.1 (rails 3)
问题描述
以下代码用于正常运行,而没有尝试使用jQuery verion 1.6渲染新模板.我安装了jQuery 1.6.1,现在单击单选按钮会尝试呈现新页面.
The following code used to function without attempting to render a new template with jQuery verion 1.6. I installed jQuery 1.6.1 and now a radio button click results in an attempt to render a new page.
仅供参考,每次单击都会提交该表单,因为相当多的客户会完成部分问题,关闭浏览器,并希望他们的工作在完成时就在那里.如果有更好的方法,我很想知道.
FYI, the form was submitted on each click because quite a few clients would complete part of the questions, close the browser and expect their work to be there when they came back to finish. If there is a better way, I'd love to know it.
在开发机上的application.js中:
in the application.js on development machine:
$('.submittable').live
('change', function()
{
$(this).parents('form:first').submit();
return false;
}
);
同样,这适用于jQuery 1.6,但不适用于1.6.1.我使用了本教程作为指导.
Again, this works in jQuery 1.6 but not 1.6.1. I used this tutorial as a guide.
感谢您的帮助.