I been looking at http://blog.jeremymartin.name/2008/02/jtruncate-in-a开发者_如何转开发ction.html. It doesn't seem to work for html added to the page after page load.
Does anyone know how that would work or if there is a better solution?
The simplest solution to your problem is to call the jTruncate constructor on the HTML returned by your AJAX calls. Like so:
$.ajax(
{
    success: function (html) // HTML is returned
    {
        // Enable jTruncate on the HTML
        var truncatedHTML = $(html).jTruncate(/* options */);
        // Append the HTML to your page
        $("element to append to").append(truncatedHTML);
    }
});
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论