"namePresent"%> 我的 application.js 文件包含 $(".namePresent").live('click'-6ren">
gpt4 book ai didi

javascript - 单选按钮(带点击事件)不在 Firefox 中传递参数

转载 作者:行者123 更新时间:2023-11-29 15:00:56 24 4
gpt4 key购买 nike

我的表单中嵌入了单选按钮

<%= f.radio_button :name_present,true,:class => "namePresent"%>
<%= f.radio_button :name_present,false,:class => "namePresent"%>

我的 application.js 文件包含

$(".namePresent").live('click',function(e){

$("#form").submit();
//form is the id of my form_for
});

所有的参数在chrome中都是传递的,但是在firefox中单选按钮的参数是不传递的。

最佳答案

我应该指出 livebind 都已弃用。您可以使用 .on()

执行这两项操作

尝试:

$(".namePresent").on('click',function(e){

$("#form").submit();
//form is the id of my form_for
});

查看link .

关于javascript - 单选按钮(带点击事件)不在 Firefox 中传递参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10277210/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com