因此,我有其他人的旧代码,我正在尝试恢复。我对jQuery不是很熟悉,但是@操作符指定了什么?
代码是:
v_button_format = $('#' + v_form_id).find('input[@name=button_format]').val();
v_content_type = $('#' + v_form_id).find('input[@name=content_type]').val();我正在使用jQuery 1.3,它抛出了一个“未捕获的异常:语法错误,无法识别的表达式:@name=button_format”错误。是否存在兼容性问题?
发布于 2011-08-25 23:08:32
这意味着attribute。input[@name=button_format]的意思是the input tag with the name attribute equal to button_format。
但是,在最新版本的jQuery中,您需要删除@和引号button_format。这意味着@不是向后兼容的。So quoth the docs。
注意: jQuery 1.3 @attr样式选择器中的已被删除(它们以前在jQuery 1.2中已被弃用)。只需从您的选择器中删除“@”符号,以使它们再次工作。
https://stackoverflow.com/questions/7192760
复制相似问题