You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using this plugin and having some problems with tags not being closed, then I realised that you can use the following to get jQuery to close any open tags for you:
var safeShortString = $('<div/>').html(shortString).html();
So, when the string has to be truncated, just pass the truncated shortString as above and jQuery sorts it out for you and you don't need all that char-by-char parsing code.
I've tested this with jQuery 1.7.2
The text was updated successfully, but these errors were encountered:
I was using this plugin and having some problems with tags not being closed, then I realised that you can use the following to get jQuery to close any open tags for you:
So, when the string has to be truncated, just pass the truncated shortString as above and jQuery sorts it out for you and you don't need all that char-by-char parsing code.
I've tested this with jQuery 1.7.2
The text was updated successfully, but these errors were encountered: