1
Vote

JS error in IE8: 'undefined' is null or not an object

description

I have the following error in IE8 using query.flexbox 0.9.6.1:

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Timestamp: Wed, 23 Jan 2013 10:13:22 UTC
Message: 'undefined' is null or not an object
Line: 305
Char: 5
Code: 0

FYI I feed the JSON directly to the FlexBox instead of using a script to retrieve it. Anyway I've made a fix that you can implement if you want to...

replace line 314:

var indexOfMatch = data[o.resultsProperty][i][o.displayValue].toLowerCase().indexOf(params.q.toLowerCase());

by the following block:

var indexOfMatch;
if (data[o.resultsProperty][i] != undefined) {
indexOfMatch = data[o.resultsProperty][i][o.displayValue].toLowerCase().indexOf(params.q.toLowerCase());
} else indexOfMatch = -1;


I hope it helps

comments