我有一个自定义生成的Web应用程序的JS文件。我在firefox控制台上得到的是在代码的特定行上的消息“空字符串传递给getElementById()”。错误计数,在每次点击时添加四(4)..在某些时候,浏览器开始扫描,直到它发出错误提示“脚本已停止工作或正忙于行:36,停止脚本或继续” 行是: if(o=a.getElementById(i[2]),o&&o.parentNode){
空字符串传递给getElementById()上自定义js
某些代码:
q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},
_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),
e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),
e.detachEvent("onload",q))};
x.fn=x.prototype={jquery:f,constructor:x,
init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){
if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)
return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);
if(i[1]){
if(n=n instanceof x?n[0]:n,
x.merge(this,
x.parseHTML(i[1],
n&&n.nodeType?n.ownerDocument||n:a,!0)),
k.test(i[1])&&x.isPlainObject(n))
for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}
>>>>>This line error>>>>>> if(o=a.getElementById(i[2]),o&&o.parentNode){
if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}
return this.context=a,
this.selector=e,this}
如果你发布非缩小的JS,那会很好。跟踪所有这些单字母变量是真正的人才流失。 – Barmar
这是jQuery的document.ready函数缩小的不是吗?你可能在其他地方有一个错误,它只是显示为一个内部jQuery错误,可能是因为你在某处做了一个booboo。 – adeneo