jQuery“返回假"适用于1.6版,但不适用于1.6.1版(rails 3) [英] jQuery "return false" works in version 1.6 but not 1.6.1 (rails 3)

查看:47
本文介绍了jQuery“返回假"适用于1.6版,但不适用于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.

感谢您的帮助.

更新:此问题的继续推荐答案

问题是生产机器上的jQuery版本和开发机器上的jQuery版本.在开发机器上,我们从1.6 full更改为1.6.1 min.当我把它改回来的时候,问题就消失了.感谢您的帮助.感谢泰达人.如果他发帖,我将答案切换给他.

The problem was one version of jQuery on the production machine and another on the development machine. We changed from 1.6 full to 1.6.1 min on the development machine. When i changed it back the problem disappeared. Thanks for all your help guys. Kudos to thedaian. I'll switch the answer over to him if he posts.

这篇关于jQuery“返回假"适用于1.6版,但不适用于1.6.1版(rails 3)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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