While debugging some jQuery that is not working in IE, I found this error message:
var item = $("#item_"+ itemArray[itemIndex]).find('a').text().trim();
Object doesn't support this property or method (script.js, line 100, character 2)
The character 2
doesn't make sense to me. Based on the text displayed character 2
would be the letter a
in var
but of course that doesn't make any sense.
(Should I not use var
?)
I know that jQuery is working to some extent or the script would not have been able to get this far on my page.
IE doesn't have a trim
method.
Instead, you can call jQuery.trim(...)
.
IE doesn't have String.trim()
, you'll need $.trim()
(which uses native trim if available, emulates it in IE), like this:
var item = $.trim($("#item_"+ itemArray[itemIndex]).find('a').text());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With