The first time I call a function using .split(), it fails, but thereafter it works. Any idea why it is so in IE9? Does anyone have experience with this bug/intricacy and on fixing it? If not that, is there a substitute for .split() that works seamlessly in IE8 and 9? Thanks very much.
EDIT:
the error message that shows up the first time the function is called is:
ERROR: SCRIPT5007: Unable to get value of the property 'split': object is null or undefined.
EDIT2, Code that brings up error:
function parseArgs() {
...
var urlParams = $(allE[i]).css('list-style-image').split('?')[1].split('_');
...
}
To avoid the error, test if the string objects are not null. Null does’t have members: