rviscomi/trunk8

Dynamic ajax update of content not working after calling trunk8

schniedan opened this issue · 3 comments

Hi.

I'm running setInterval-timed-ajax calls to update text in my webapp. The first call works, the content is properly truncated with "...". But after that first call my jQuery-ajax-update calls won't work any more. I do see something happening with the content due to text-selection-unselection at the specific update-times but the actual content doesn't change. Since something is happening, the jQuery-selectors still seem to work. But why is the content not replaced? I don't have any idea.

Here's how the html looks:

<div class="divComponent comp0">
<div class="divContent contentComponent0" id="contentComp0">
<div class="divTitle contentComponent0"><h1 class="componentTitle"></h1></div>
<div id="infoImage" class="divInfoImage componentImage"></div>
<p class="componentText"></p>               
</div>
</div>

Here's the jQuery-part:

$("div.contentComponent" + i + " > p.componentText").text("[I]" + currentContent.text);
$("div.contentComponent" + i + " > p.componentText").trunk8({lines: 9});

Many thanks in advance for any hints on this!
meph

Try using the update method to replace and trunk8 text in one step: http://jrvis.com/trunk8/#update

Ok, that works. Thanks a lot. But could you tell me, why? Why does the "normal" accessing not work any more? Why do I need the specific update method?

I would have to see live code or a JS Fiddle for debugging to explain why it wasn't working. Could you create a fiddle that demonstrates the broken behavior?