function $(id) { if (typeof jQuery == 'undefined' || (typeof id == 'string' && document.getElementById(id))) { return document.getElementById(id); } else if (typeof id == 'object' || !/^\w*$/.exec(id) || /^(body|div|span|a|input|textarea|button|img|ul|li|ol|table|tr|th|td)$/.exec(id)){ return jQuery(id); } return null;}2、修改jquery调用的代码:
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j(”div”).hide();
});
$j(”div”).hide();部分中,把自己的调用元素代码都加上j字母就可以了。
感谢:第一种方法引入: http://www.coolneng.com/?thread-index-fid-6-tid-366.htm
第二种方法:http://www.jb51.net/article/22013.htm