Fix WebViewer from breaking

I have tested
var oSentence = "";
but the text is loading with stuck for sometimes.

1 Like

Don't know what the script/app is to do. But the error might lie in the "document.write(...)". After that the entire script is lost so that the following statement "smoothScroll(...getElementById("top")" cannot be executed correctly. The element "top" doesn't exist anymore.image
Instead one might use a "p" tag:

<p id="write"> </p>
<>
document.getElementById("write").innerHTML = window.AppInventor.getWebViewString();
smooth....
.... setWebViewString("go");
<>

Ref.: W3Schools
Definition and Usage

The write() method is mostly used for testing: If it is used after an HTML document is fully loaded, it will delete all existing HTML.

2 Likes

Hello Joerg_Kowalski,

The script is doing 3 things:

1- One code is for when I touch the screen it hides and unhides the top table and below table that contain the title and menu.
2- One code is for highlight the sentences when sound starts. So, it highlight one by one until highlight the last sentence.
3- One code is for resize the font.

So, according to my recommendation above that doesn't fix the bug? Then I'm afraid, only an expert who knows a lot more than me can help and/or more detailed information about your code.

Thank you so much Joerg_Kowalski for trying to help me.