jquery-1.3.2.min.js和一个js文件冲突,求具体解决方案,不要网上复制粘贴的,谢谢
和jquery-1.3.2.min.js冲突的js代码为var$=function(_id){returndocument.getElementById(_id);};v...
和jquery-1.3.2.min.js冲突的js代码为
var $ = function(_id)
{
return document.getElementById(_id);
};
var $F = function(_id)
{
var tid = _id;
var tobj = null;
try
{
tobj = document.frames[tid];
} catch(e){};
if (tobj == null)
{
try
{
tobj = $(tid).contentWindow;
} catch(e){};
};
return tobj;
};
var attachElementEvent = function(_obj, _eventName, _handler, _object)
{
var tobj = _obj;
var teventName = _eventName;
var thandler = _handler;
var teventHandler = _handler;
var tobject = _object;
if (tobj)
{
if (tobject)
{
teventHandler = function(e)
{
thandler.call(tobject, e);
};
};
try {tobj.addEventListener(teventName, teventHandler, false);}
catch(e)
{
if (teventName == 'keypress') tobj = tobj.document;
tobj.attachEvent('on' + teventName, teventHandler);
};
};
};
var cinstr = function(_strers, _str, _spstr)
{
var tstrers = _strers;
var tstr = _str;
var tspstr = _spstr;
var tbool = false;
if (tstrers)
{
if (tstrers.indexOf(tspstr + tstr + tspstr) != -1) tbool = true;
else
{
if (tstrers.substr(0, tstrers.indexOf(tspstr)) == tstr) tbool = true;
else
{
if (tstrers.substr(tstrers.lastIndexOf(tspstr) + tspstr.length) == tstr) tbool = true;
};
};
};
return tbool;
};
var createScript = function(_stroid, _strid, _strURL)
{
var tstroid = _stroid;
var tobj = $(tstroid);
if (tobj)
{
var tstrid = _strid;
var tstrURL = _strURL;
var tScript = document.createElement('script');
tScript.type = 'text/javascript';
tScript.id = tstrid;
tScript.src = tstrURL;
tobj.appendChild(tScript);
};
};
var iescape = function(_strers)
{
var tstrers = _strers;
tstrers = encodeURIComponent(tstrers);
tstrers = encodeURIComponent(tstrers);
return tstrers;
};
var nll = function(_strers)
{
};
var request = new function()
{
var tstrers = location.href;
var tiname, tivalue, ticount;
var tinum = tstrers.indexOf('?');
tstrers = tstrers.substr(tinum + 1);
var tarrtmp = tstrers.split('&');
for(ticount = 0; ticount < tarrtmp.length; ticount ++)
{
tinum = tarrtmp[ticount].indexOf('=');
if(tinum > 0)
{
tiname = tarrtmp[ticount].substring(0, tinum);
tivalue = tarrtmp[ticount].substr(tinum + 1);
this[tiname] = tivalue;
};
};
};
var setInnerHTML = function(_obj, _strers)
{
var tobj = _obj;
var tstrers = _strers;
if (tobj)
{
tobj.innerHTML = tstrers;
var tobjs = tobj.getElementsByTagName('dfn');
for(ti = 0; ti < tobjs.length; ti ++)
{
try
{
eval(tobjs[ti].getElementsByTagName('textarea').item(0).value);
}
catch(e) {};
};
};
};跪求解决。。。 展开
var $ = function(_id)
{
return document.getElementById(_id);
};
var $F = function(_id)
{
var tid = _id;
var tobj = null;
try
{
tobj = document.frames[tid];
} catch(e){};
if (tobj == null)
{
try
{
tobj = $(tid).contentWindow;
} catch(e){};
};
return tobj;
};
var attachElementEvent = function(_obj, _eventName, _handler, _object)
{
var tobj = _obj;
var teventName = _eventName;
var thandler = _handler;
var teventHandler = _handler;
var tobject = _object;
if (tobj)
{
if (tobject)
{
teventHandler = function(e)
{
thandler.call(tobject, e);
};
};
try {tobj.addEventListener(teventName, teventHandler, false);}
catch(e)
{
if (teventName == 'keypress') tobj = tobj.document;
tobj.attachEvent('on' + teventName, teventHandler);
};
};
};
var cinstr = function(_strers, _str, _spstr)
{
var tstrers = _strers;
var tstr = _str;
var tspstr = _spstr;
var tbool = false;
if (tstrers)
{
if (tstrers.indexOf(tspstr + tstr + tspstr) != -1) tbool = true;
else
{
if (tstrers.substr(0, tstrers.indexOf(tspstr)) == tstr) tbool = true;
else
{
if (tstrers.substr(tstrers.lastIndexOf(tspstr) + tspstr.length) == tstr) tbool = true;
};
};
};
return tbool;
};
var createScript = function(_stroid, _strid, _strURL)
{
var tstroid = _stroid;
var tobj = $(tstroid);
if (tobj)
{
var tstrid = _strid;
var tstrURL = _strURL;
var tScript = document.createElement('script');
tScript.type = 'text/javascript';
tScript.id = tstrid;
tScript.src = tstrURL;
tobj.appendChild(tScript);
};
};
var iescape = function(_strers)
{
var tstrers = _strers;
tstrers = encodeURIComponent(tstrers);
tstrers = encodeURIComponent(tstrers);
return tstrers;
};
var nll = function(_strers)
{
};
var request = new function()
{
var tstrers = location.href;
var tiname, tivalue, ticount;
var tinum = tstrers.indexOf('?');
tstrers = tstrers.substr(tinum + 1);
var tarrtmp = tstrers.split('&');
for(ticount = 0; ticount < tarrtmp.length; ticount ++)
{
tinum = tarrtmp[ticount].indexOf('=');
if(tinum > 0)
{
tiname = tarrtmp[ticount].substring(0, tinum);
tivalue = tarrtmp[ticount].substr(tinum + 1);
this[tiname] = tivalue;
};
};
};
var setInnerHTML = function(_obj, _strers)
{
var tobj = _obj;
var tstrers = _strers;
if (tobj)
{
tobj.innerHTML = tstrers;
var tobjs = tobj.getElementsByTagName('dfn');
for(ti = 0; ti < tobjs.length; ti ++)
{
try
{
eval(tobjs[ti].getElementsByTagName('textarea').item(0).value);
}
catch(e) {};
};
};
};跪求解决。。。 展开
3个回答
展开全部
这个文件使用了美元符号,和JQUERY冲突了,给你几个解决方法:
先加载JQUERY,然后使用语句 jQuery.noConflict();
再加载其他JS文件,后面在使用jQuery时都换下,如:$('#div') 换成 jQuery('#div'),
如果嫌jQuery太长可以 $j = jQuery; $j('#div')
<script src="jquery.js"></script>
<script>
jQuery.noConflict();
</script>
<script src="其他.js"></script>
先加载JQUERY,然后使用语句 jQuery.noConflict();
再加载其他JS文件,后面在使用jQuery时都换下,如:$('#div') 换成 jQuery('#div'),
如果嫌jQuery太长可以 $j = jQuery; $j('#div')
<script src="jquery.js"></script>
<script>
jQuery.noConflict();
</script>
<script src="其他.js"></script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询