# The code to show only part of the text works on preview but not inline.

**URL:** <https://forum.wixstudio.com/t/the-code-to-show-only-part-of-the-text-works-on-preview-but-not-inline/10271>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [December 15, 2020, 8:20am UTC](https://forum.wixstudio.com/t/the-code-to-show-only-part-of-the-text-works-on-preview-but-not-inline/10271 "2020-12-15T08:20:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![amksecurite82](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/amksecurite82/32/7839_2.png) [@amksecurite82](https://forum.wixstudio.com/u/amksecurite82)\
**Post date:** [December 15, 2020, 8:20am UTC](https://forum.wixstudio.com/t/the-code-to-show-only-part-of-the-text-works-on-preview-but-not-inline/10271/1 "2020-12-15T08:20:00Z")

</div>

Hello people, this has been really urgent for three days. I made this code to only show part of the texts in the homepage, and it was working but for three days it has stopped working and I have no idea what happened. Permissions are for everyone and sandbox / live are synchronized. The strangest thing is that everything is normal in preview, but not in the online version. PLEASE HELP MEEE!

$w.onReady( () =\> { $w( " [#dataset1](https://www.wix.com/corvid/forum/search/~num~dataset1) " ).onReady( () =\> {  
$w( " [#repeater1](https://www.wix.com/corvid/forum/search/~num~repeater1) " ).onItemReady( ($item, itemData, index) =\> {  
let theItem = itemData.description;  
var shortDescription = theItem.substr( 0 , 25 );  
$item( " [#description](https://www.wix.com/corvid/forum/search/~num~description) " ).text = shortDescription + " . . . " ;  
});

} );

} );

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [December 15, 2020, 9:23am UTC](https://forum.wixstudio.com/t/the-code-to-show-only-part-of-the-text-works-on-preview-but-not-inline/10271/2 "2020-12-15T09:23:55Z")

</div>

Please post the URL of your site and explain where and how to see this problem.

---

<div class="post-metadata">

**Author:** ![amksecurite82](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/amksecurite82/32/7839_2.png) [@amksecurite82](https://forum.wixstudio.com/u/amksecurite82)\
**Post date:** [December 15, 2020, 10:19am UTC](https://forum.wixstudio.com/t/the-code-to-show-only-part-of-the-text-works-on-preview-but-not-inline/10271/3 "2020-12-15T10:19:28Z")

</div>

[https://amksecurite82.wixsite.com/braverrt](https://amksecurite82.wixsite.com/braverrt)

---

<div class="post-metadata">

**Author:** ![amksecurite82](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/amksecurite82/32/7839_2.png) [@amksecurite82](https://forum.wixstudio.com/u/amksecurite82)\
**Post date:** [December 15, 2020, 10:28am UTC](https://forum.wixstudio.com/t/the-code-to-show-only-part-of-the-text-works-on-preview-but-not-inline/10271/4 "2020-12-15T10:28:35Z")

</div>

[https://amksecurite82.wixsite.com/braverrt](https://amksecurite82.wixsite.com/braverrt)

 ![](https://us1.discourse-cdn.com/wix/original/3X/d/b/dbb4103fe2ed2c519e27f7cbc4afb3137f9f1ce4.png)

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [December 15, 2020, 10:51am UTC](https://forum.wixstudio.com/t/the-code-to-show-only-part-of-the-text-works-on-preview-but-not-inline/10271/5 "2020-12-15T10:51:18Z")

</div>

Some observations:

Your code has two page onReady() functions. Inside each of the page onReady() functions, you have a dataset onReady() with a Repeater onItemReady().

You should only have one page onReady(). Having multiple page onReady() functions might lead to unpredictable behavior.

You should only have one dataset onReady() function.

You should only have one Repeater onItemReady() function. Furthermore, the onItemReady() function should not be inside of the dataset onReady() function.

The second onItemReady() has errors flagged:

 ![](https://us1.discourse-cdn.com/wix/original/3X/6/8/685435b46d24ae5ce8926cd3462911eb198a5808.png)

You will need to correct these issues before we can perform any further evaluation of your site.

---

<div class="post-metadata">

**Author:** ![amksecurite82](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/amksecurite82/32/7839_2.png) [@amksecurite82](https://forum.wixstudio.com/u/amksecurite82)\
**Post date:** [December 15, 2020, 11:14am UTC](https://forum.wixstudio.com/t/the-code-to-show-only-part-of-the-text-works-on-preview-but-not-inline/10271/6 "2020-12-15T11:14:17Z")

</div>

OK I correct here is the current code  
its still not walking

$w.onReady( () =\> {  
$w( “#dataset1” ).onReady( () =\> {

```
$w( "#repeater1" ).onItemReady( ($item, itemData, index) => { 

```

**let** theItem = itemData.description;  
**var** shortDescription = theItem.substr( 0 , 15 );  
$item( “#description” ).text = shortDescription + " . . . En Savoir Plus" ;  
});

} );

} );

---

<div class="post-metadata">

**Author:** ![yisrael-wix](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yisrael-wix/32/1107_2.png) [@yisrael-wix](https://forum.wixstudio.com/u/yisrael-wix)\
**Post date:** [December 15, 2020, 11:24am UTC](https://forum.wixstudio.com/t/the-code-to-show-only-part-of-the-text-works-on-preview-but-not-inline/10271/7 "2020-12-15T11:24:31Z")

</div>

The issue appears to be related to a recent performance release. I’ve reconfigured your site and it should be working properly now.

---

<div class="post-metadata">

**Author:** ![amksecurite82](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/amksecurite82/32/7839_2.png) [@amksecurite82](https://forum.wixstudio.com/u/amksecurite82)\
**Post date:** [December 17, 2020, 2:57am UTC](https://forum.wixstudio.com/t/the-code-to-show-only-part-of-the-text-works-on-preview-but-not-inline/10271/8 "2020-12-17T02:57:17Z")

</div>

ok thanks everything is working fine now
