I have a script:
_content_insert: function () {
var e = this,
t = this.$tooltip.find(".tooltipster-content");
if (typeof e.Content === "string" && !e.options.contentAsHTML) {
t.text(e.Content)
} else {
t.empty().append(e.Content)
}
},
and I'd like to truncate the Content to 140 characters.
I found a truncating script here - Truncate a string straight javascript
var length = 3;
var myString = "ABCDEFG";
var myTruncatedString = myString.substring(0,length);
How do I implement this into the code so that what comes out in (e.Content) is the truncated 140-character string?