首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

jquery-1.2.6和jquery-1.6.2兼容性有关问题

2012-10-20 
jquery-1.2.6和jquery-1.6.2兼容性问题刚将jquery-1.2.6.js替换成query-1.6.2.js文件时发现一个问题,?scr

jquery-1.2.6和jquery-1.6.2兼容性问题

刚将jquery-1.2.6.js替换成query-1.6.2.js文件时发现一个问题,

?

<script type="text/javascript" src="js/jquery-1.6.2.js"></script>

?

<input type="checkbox" onclick="select_cancel($(this));" name="entityIds" name="entityIds" name="code">function select_cancel(obj) {            //ignore undefined            var selected = false;            if (obj.attr("checked")) {                selected = true;            }            obj.click(function() {                $("input[@name='entityIds']").each(function() {                    $(this).attr("checked", selected);                });            });        }

???????? 此时在jquery-1.6.2.js第4057行报出语法解析错误:

Sizzle.error = function( msg ) {throw "Syntax error, unrecognized expression: " + msg;};

但当将1.6.2换成1.2.6时却能正常解析,可见在1.6.2版本中对去掉了@name过滤了方式 ,

即在使用jquery-1.6.2.js时将$("input[@name='entityIds']")改为$("input[name='entityIds']"),也能正常解析。

?

?

热点排行