jQuery loop slice

I am trying to truncate the characters of some sections that are automatically generated.
While I can see that it does the job on the console, it doesn’t appear on the website (https://help.peeba.com/hc/zh-tw)

My code:

if ($(location.href.indexOf("zh-tw") > -1) || (location.href.indexOf("zh-cn"))) {

  var str = $('.p-article-description').text();
  var res = str.slice(0, 48);
    function(i, v) {
      $('.p-article-description').slice(0, 40);


Any ideas?


2 thoughts on “jQuery loop slice”

  1. Its like you read my mind! You appear to grasp a lot approximately this, like you wrote the e-book in it or something.
    I think that you simply can do with some
    percent to drive the message house a bit, however instead of that, this is great blog.

    A great read. I will certainly be back.


Leave a Comment