I tested the following in FF, OP, Chrome, Safari and IE. It works in them all except 3 IE that I tested: 8, 7 and 6.
// truncate testimonial var visiblePara = $('div.bannerUnder p.show'); if (visiblePara.text().trim().length > 150) { var text = visiblePara.text().trim(); var author = $('div.bannerUnder p.show > strong').text(); text = text.substr(0, 150) + "..."; visiblePara.text(text).append("<strong>" + author + "</strong>"); }
It says:
The object does not support this property or method and points to this line:
if (visiblePara.text().trim().length > 150) {
What could be the problem?
javascript jquery cross-browser internet-explorer
James
source share