benschwarz / developers.whatwg.org

Used to create the contents of developers.whatwg.org
http://developers.whatwg.org/
198 stars 39 forks source link

Search thingie doesn't work in Opera #21

Closed zcorpan closed 13 years ago

zcorpan commented 13 years ago

Dump from error console:

JavaScript - http://developers.whatwg.org/
Inline script thread
Uncaught exception: TypeError: Cannot convert 'node' to object
Error thrown at line 2, column 107 in <anonymous function>(type, node, fn) in  http://developers.whatwg.org/javascript/application.js:
node.addEventListener(type,fn,false)
called from line 3, column 626 in http://developers.whatwg.org/javascript/application.js:
addEvent("keyup",q,function(e){var queryLowerCase=q.value.toLowerCase(),queryStartRe=new RegExp("^"+queryLowerCase,"i"),resultList=[],startI=-1,allI=-1,maxResults=10,jsonResponse;while((jsonResponse=jsonResponses[++startI])){var resultText=jsonResponse.text,resultTextLowerCase=resultText.toLowerCase(),resultURL=jsonResponse.uri,resultSection=jsonResponse.section;if(maxResults&&queryStartRe.test(resultTextLowerCase)){resultList.push('<li><a href="http://developers.whatwg.org/'+resultURL+'">'+resultText+" <span>Section "+resultSection+"</span></a></li>");--maxResults}}while((jsonResponse=jsonResponses[++allI])){var resultText=jsonResponse.text,resultTextLowerCase=resultText.toLowerCase(),resultURL=jsonResponse.uri,resultSection=jsonResponse.section;if(maxResults&&resultTextLowerCase.indexOf(queryLowerCase)>-1){resultList.push('<li><a href="http://developers.whatwg.org/'+resultURL+'">'+resultText+" <span>Section "+resultSection+"</span></a></li>");--maxResults}}r.innerHTML=resultList.join("")});
benschwarz commented 13 years ago

Thanks for the error report. I'm seeing this on Safari mobile too. The original script was working so its either minification or the fact that I removed the empty <li></li> from the OL, I'm thinking the latter.

Can you retest it now?

benschwarz commented 13 years ago

Damn. Still failing in Opera 11

benschwarz commented 13 years ago

Got it.