HasData中来自JSONParse的神秘jQuery错误

Mysterious jQuery errors from JSONParse in HasData

本文关键字:jQuery 错误 JSONParse HasData      更新时间:2023-09-26

当我尝试使用jQuery运行web应用程序时,遇到了一组奇怪的错误。我突然得到"e未定义"answers"JSON.parse:意外字符"恐怕我不知道这些东西在哪里或为什么存在——以前有人见过/处理过吗?它似乎与.bound()或给定.on()操作的某些元素混淆了。当我从选择菜单中对焦时,这个意想不到的角色似乎就在身边。

Firebug堆栈跟踪:

TypeError: e is undefined
hasData(e=undefined)jquery...0130612 (line 5)
hasData(e=[Object[div.tooltip]], t=undefined, n=false, r=Object[qp { gm_accessors_={...}, __gm_id=530, gm_bindings_={...}, more...}])jquery...0130612 (line 5)
hasData(e=[Object[div.tooltip]], t=function(), n=undefined)jquery...0130612 (line 5)
hasData()jquery...0130612 (line 5)
hasData(e=Object[qp { gm_accessors_={...}, __gm_id=530, gm_bindings_={...}, more...}])jquery...0130612 (line 5)
show()bootst...0130521 (line 141)
tooltip()bootst...0130521 (line 334)
x(e=Object[qp { gm_accessors_={...}, __gm_id=530, gm_bindings_={...}, more...}], t=function(), n=undefined)jquery...0130612 (line 4)
x(e=function(), t=undefined)jquery...0130612 (line 4)
tooltip(option="show")bootst...0130521 (line 329)
mapperFunctions_proximityCheck(isForSale=true)mapper...ions.js (line 579)
(?)()routeMapper.js (line 27)
trigger(a=$g { gm_accessors_={...}, map=mp, gm_bindings_={...}, more...}, b="directions_changed", c=undefined)main.js (line 23)
sg(a=$g { gm_accessors_={...}, map=mp, gm_bindings_={...}, more...}, b="directions")main.js (line 29)
dd(a="directions", b=Object { routes=[1], status="OK", Vb={...}})main.js (line 28)
bindTo(c=Object { routes=[1], status="OK", Vb={...}})main.js (line 30)
(?)(result=Object { routes=[1], status="OK", Vb={...}}, status="OK")routeMapper.js (line 150)
mapMaker_changed(a=1)1 (line 37)
nA(d=function())1 (line 22)
mapMaker_changed()1 (line 37)
(?)(b=Object { routes=[1], status="OK", Vb={...}}, c="OK")5 (line 8)
(?)(b=Object { routes=[1], status="OK", Vb={...}})5 (line 5)
dB(a=Object { routes=[1], status="OK", Vb={...}})1 (line 33)
DirectionsService.Route?4b0&5m2&1m1&2sCedarville%20University%2C%20Cedarville%2C%20OH&5m2&1m1&2s37659&6e0&12sen-US&100b0&102b0&callback=_xdc_._3i4ew&token=97219()Direct...n=97219 (line 450)

...s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!=...
3
jquery...0130612 (line 5)
SyntaxError: JSON.parse: unexpected character
x(n=undefined)jquery...0130612 (line 4)
attachValidation(c=Object[span.input-validation-error], d=Object[select#Type])jquery....min.js (line 5)
x()jquery...0130612 (line 4)
customMetaMessage(element=select#Type, message=undefined)jquery....min.js (line 16)
customMetaMessage()jquery....min.js (line 16)
validate(errors=undefined)jquery....min.js (line 15)
validate(element=select#Type)jquery....min.js (line 15)
validate(element=select#Type)jquery....min.js (line 15)
validate(event=Object { type="focusout", timeStamp=0, jQuery11010036435891111683105=true, more...})jquery....min.js (line 15)
customMetaMessage(event=Object { type="focusout", timeStamp=0, jQuery11010036435891111683105=true, more...})jquery....min.js (line 16)
hasData(e=Object { type="focusout", timeStamp=0, jQuery11010036435891111683105=true, more...})jquery...0130612 (line 5)
hasData(e=Object { type="focusout", timeStamp=0, jQuery11010036435891111683105=true, more...})jquery...0130612 (line 5)
hasData(n=Object { type="focusout", timeStamp=0, jQuery11010036435891111683105=true, more...}, r=[Object { type="focusout", timeStamp=0, jQuery11010036435891111683105=true, more...}], i=select#Type, o=undefined)jquery...0130612 (line 5)
hasData(e="focusout", t=select#Type, n=Object { originalEvent=Event blur, type="blur", timeStamp=0, more...}, r=true)jquery...0130612 (line 5)
hasData(e=blur )jquery...0130612 (line 5)

...nectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t...

至少对于JSON.parse错误,我发现拥有对象的名称/id="Type"是有问题的;当简单地改为"AdType"时,它就起作用了。我不知道这是否能切中要害,但我认为它起作用。